Page 1 of 1

Subtitle encoding on Samsung C series

PostPosted: Fri Jan 13, 2012 3:17 pm
by vmonkey
Hi,
I come from the Czech Republic and the most of subtitles for movies come encoded in WIN-1250 encoding. The problem is, however, that the central-european languages (such as Czech, Polish etc.) contain accents -> š, č, ť, é etc. Because Samsung TVs do handle only UTF-8 subtitles it happens that instead of "Náš svět pravděpodobně nečelil" we may see only "Nᚠsvìt pravdìpodobnì neèelil", which is not really comfortable to read. Is there an easy way to check subtitle encoding and if not correct encode it to UTF-8 to avoid manual encoding?
Thanks for help.

Re: Subtitle encoding on Samsung C series

PostPosted: Fri Jan 13, 2012 3:30 pm
by zip
vmonkey wrote:Hi,
I come from the Czech Republic

Welcome fellow Czech ;-)

Googled this: http://www.melody-soft.com/html/unifier.html

Re: Subtitle encoding on Samsung C series

PostPosted: Fri Jan 13, 2012 3:38 pm
by vmonkey
Thanks for your answer. I know about batch conversion (and it is not a problem to write a bash script for that purpose, as I am on Linux). I just thought of an option to deal with it at all automatically without any user activity. But still thanks for your great product!

Re: Subtitle encoding on Samsung C series

PostPosted: Fri Jan 13, 2012 4:58 pm
by zip
Encoding detection is almost impossible so I'd get it wrong in many cases. It's better for the user to deal with it.

Re: Subtitle encoding on Samsung C series

PostPosted: Fri Dec 14, 2012 3:52 pm
by pepa.sajdler
Hi, for those who use Notepad++

you don't need to download any other SW, just download a plugin called Python Script

Then in Notepad++ go to menu Plugins -> Python Script -> New Script, choose a filename and save it, then paste this:
  Code:
import os;
import sys;

console.clear()
console.show()
filePathSrc="Your:\\Escaped\\Path\\"
for root, dirs, files in os.walk(filePathSrc):
   for fn in files:
      if (fn[-4:] == '.txt') or (fn[-4:] == '.srt') or (fn[-4:] == '.sub'):
         notepad.open(root + "\\" + fn)
         notepad.menuCommand(45011)
         console.write("Converting " + root + "\\" + fn+"\n")
         notepad.save()
         notepad.close()
console.write("Everything done!\n")
edit filePathSrc (don't forget to escape \ {\ -> \\} etc...), save and run - Plugins -> Python Script -> Scripts -> Your named script.

I'm not the original author of the script, I found it somwhere on the internet - so credit goes there.

22JUN2013 uodate
    UTF-8 check removed - it was causing problems (my mistake - I tried to check if the file wasn't already UTF-8 encoded, instead it switched encoding without converting in some cases...)
    It looks like the console.write is a necessity - on my machine the script would be to fast and causing problems without it (closing other open files, creating new empty ones etc...)