FAQ  •  Register  •  Login

Subtitle encoding on Samsung C series

<<

vmonkey

Serviio newbie

Posts: 4

Joined: Fri Jan 13, 2012 2:32 pm

Post Fri Jan 13, 2012 3:17 pm

Subtitle encoding on Samsung C series

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.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Jan 13, 2012 3:30 pm

Re: Subtitle encoding on Samsung C series

vmonkey wrote:Hi,
I come from the Czech Republic

Welcome fellow Czech ;-)

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

vmonkey

Serviio newbie

Posts: 4

Joined: Fri Jan 13, 2012 2:32 pm

Post Fri Jan 13, 2012 3:38 pm

Re: Subtitle encoding on Samsung C series

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!
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Fri Jan 13, 2012 4:58 pm

Re: Subtitle encoding on Samsung C series

Encoding detection is almost impossible so I'd get it wrong in many cases. It's better for the user to deal with it.
<<

pepa.sajdler

Serviio newbie

Posts: 14

Joined: Tue Nov 15, 2011 7:24 pm

Post Fri Dec 14, 2012 3:52 pm

Re: Subtitle encoding on Samsung C series

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...)

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 29 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.