AMC subtitle codepage selection
-
- Posts: 3
- Joined: 17 Feb 2014, 22:25
AMC subtitle codepage selection
I found out that AMC saves subtitles only wiith utf-8 encoding. Since my samsung tv need windows-1252 (ANSI) I usually save a local copy of the script and change the code.
Could you please add an option to select the encoding?
By the way, it would be nice to add an option to name the srt file without the language tag.
Thanks
Could you please add an option to select the encoding?
By the way, it would be nice to add an option to name the srt file without the language tag.
Thanks
Re: AMC subtitle codepage selection
Not gonna add options just to make outdated devices work. You can make your own mod for that.
Just change this line:
Just change this line:
Code: Select all
def subtitleFiles = getMissingSubtitles(file:files, lang:languageCode, strict:true, output:'srt', encoding:'UTF-8', db: 'OpenSubtitles', format:'MATCH_VIDEO_ADD_LANGUAGE_TAG') ?: []
Re: AMC subtitle codepage selection
Greetings,
I also have this problem the thing is that some devices cant recognize the characters of the .srt file which is UTF-8 but can recognise UTF-8 with BOM or an ANSI.
I used the windows-1253 for encoding and working perfectly but only to get subtitles for one file.
Can you please be more specific in how can we change this for a script suball?
Thank you.
I also have this problem the thing is that some devices cant recognize the characters of the .srt file which is UTF-8 but can recognise UTF-8 with BOM or an ANSI.
I used the windows-1253 for encoding and working perfectly but only to get subtitles for one file.
Can you please be more specific in how can we change this for a script suball?
Thank you.
Re: AMC subtitle codepage selection
e.g. you can pass --encoding on the command-line, if you're not using the amc script:
https://www.filebot.net/cli.html
Alternatively, you could write a script that adds the UTF-8 BOM to all your *.srt files. That would be rather trivial.
Code: Select all
--encoding Windows-1252


Re: AMC subtitle codepage selection
I m running this via a task on my synology
filebot -script fn:suball /volume2/Disk.2/Downloads/ --lang el -non-strict
the thing is because of greek language the best is to have a utf8 with bom can i write a script at the end of the task? Do you have any idea how to do that?
Thanks.
filebot -script fn:suball /volume2/Disk.2/Downloads/ --lang el -non-strict
the thing is because of greek language the best is to have a utf8 with bom can i write a script at the end of the task? Do you have any idea how to do that?
Thanks.
Re: AMC subtitle codepage selection
Yes, writing a Groovy script is trivial. But Googling for a solution is even easier, even sed can do the job:
https://stackoverflow.com/a/35807131/1514467
https://stackoverflow.com/a/35807131/1514467
Re: AMC subtitle codepage selection
Can i make sed to search all the .srt in folder Downloads and make them utf8 with bom?
Re: AMC subtitle codepage selection
You can certainly use find -exec to find all *.srt files and call sed on them.
Re: AMC subtitle codepage selection
Is that right?
find . -name '*.srt' -type f -exec sed -i '1s/^/\xef\xbb\xbf/'
but how i ll make find to look to specific file?
find . -name '*.srt' -type f -exec sed -i '1s/^/\xef\xbb\xbf/'
but how i ll make find to look to specific file?
Re: AMC subtitle codepage selection
Maybe like this?
find /volume2/Disk.2/Downloads/ -name '*.srt' -type f -exec sed -i '1s/^/\xef\xbb\xbf/'
find /volume2/Disk.2/Downloads/ -name '*.srt' -type f -exec sed -i '1s/^/\xef\xbb\xbf/'
Re: AMC subtitle codepage selection
I think that finally found it if anyone need it this is it:
this will find all your .srt files in the specific directory and then change utf 8 to utf 8 with bom
Code: Select all
find 'path' -name '*.srt' -exec sed -i '1s/^/\xef\xbb\xbf/' {} \;