encoding autodetection and conversion for subtitle files, improved sanitization