Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
ignatzzzz
Posts: 22
Joined: Tue Jan 29, 2019 4:58 pm

UTF-8 Conversion on Upload?

Sat Feb 05, 2022 1:43 pm

It would be brilliant if all subtitle sets could be converted to UTF-8 on upload. Ninety percent of Hungarian subs need to be converted to render properly and sometimes Russian and Chinese, too. Subtitletools.com does UTF-8 conversion as a matter of course, so it's definitely do-able.

TIA

User avatar
SmallBrother
Site Admin
Posts: 3726
Joined: Sun Mar 04, 2012 12:59 pm
Location: Somewhere on this globe

Re: UTF-8 Conversion on Upload?

Sun Feb 06, 2022 11:35 am

Yes, it is doable, in fact the new .com site gives all subs in UTF-8 by default. Still, I think UTF-8 is not necessarily the ultimate. The good thing about UTF-8 is that it's ONE standard encoding for ALL characters and languages. The bad thing is that not all players support UTF-8. Also, 'local' characters sets may be set by default (for example for Hungarian it would be the CP1250 character set), and many people don't know about it or don't know how to change that. In both cases, UTF-8 encoded subs would be displayed wrongly.
Nowadays a VPN is a must for everyone. A VPN allows you safe surfing and protects you against spying governments and companies.
I advise AirVPN - from € 2,75 per month. Click the below banner for more info.


Image

ignatzzzz
Posts: 22
Joined: Tue Jan 29, 2019 4:58 pm

Re: UTF-8 Conversion on Upload?

Sun Feb 06, 2022 2:11 pm

Great! Thanks for the info... I'll try on .com... do my VIP privileges from .org transfer to .com?

User avatar
SmallBrother
Site Admin
Posts: 3726
Joined: Sun Mar 04, 2012 12:59 pm
Location: Somewhere on this globe

Re: UTF-8 Conversion on Upload?

Sun Feb 06, 2022 2:33 pm

Great! Thanks for the info... I'll try on .com... do my VIP privileges from .org transfer to .com?
That's off-topic ;-) and I am not really / really not an expert on the .com site... But if you import your .org account into .com, I think the VIP status automatically comes with it.

Btw, that website may not be the most handy method for multiple subs. Two other ways may be easier/faster:
1. Open the SRT file with Windows Notepad (or any decent plain text editor) > File > Save as... > [Select] Encoding: UTF-8
or
2. Open the SRT file in Subtitle Edit > [Select] Encoding: Unicode UTF-8 > Save
Nowadays a VPN is a must for everyone. A VPN allows you safe surfing and protects you against spying governments and companies.
I advise AirVPN - from € 2,75 per month. Click the below banner for more info.


Image

User avatar
hector
Posts: 370
Joined: Wed Jan 01, 2014 12:27 pm
Location: Spain

Re: UTF-8 Conversion on Upload?

Sun Feb 06, 2022 3:09 pm

Last year Unicode celebrated its 30th birthday.

Yes, one problem is that it is still not supported by some devices. And there are some political issues still not resolved, mainly with CJK. But I think it was a great improvement and everybody should switch to it.

I use this site mainly to learn languages and culture and sometimes it is really hard to guess the encoding of some subtitles. In Russia there were 3 different and competing encodings and this is true for many languages.

I think it is a good thing that the new site has chosen UTF-8 as default encoding. It saves a lot of time and headabhes :-)

ignatzzzz
Posts: 22
Joined: Tue Jan 29, 2019 4:58 pm

Re: UTF-8 Conversion on Upload?

Sun Feb 06, 2022 6:59 pm

Great! Thanks for the info... I'll try on .com... do my VIP privileges from .org transfer to .com?
That's off-topic ;-) and I am not really / really not an expert on the .com site... But if you import your .org account into .com, I think the VIP status automatically comes with it.

Btw, that website may not be the most handy method for multiple subs. Two other ways may be easier/faster:
1. Open the SRT file with Windows Notepad (or any decent plain text editor) > File > Save as... > [Select] Encoding: UTF-8
or
2. Open the SRT file in Subtitle Edit > [Select] Encoding: Unicode UTF-8 > Save
Thanks, but I don't use Windows. Saving as UTF-8 in TextEdit on a Mac doesn't seem to do anything...

boeiahwa
Posts: 1
Joined: Wed Feb 09, 2022 6:25 pm

Re: UTF-8 Conversion on Upload?

Wed Feb 09, 2022 8:38 pm

It is a disaster to convert encoding on MacOS. Been there, done that. I wrote and use this script on WSLv2 but works on Mac and Linux as well. It needs the packages: sed or gsed, iconv, uchardet which can be installed using brew.

enco.sh:
#!/bin/bash

if command -v gsed &> /dev/null; then
regexec="gsed"

elif command -v sed &> /dev/null; then
regexec="sed"
else
echo "Executables not working."
exit 0
fi

for fn in "${@}"; do

fn="$(realpath $fn)"

fenc="$(uchardet "$fn")"
tenc=UTF-8

if [ "$fenc" = "ISO-8859" ]; then
fenc="ISO-8859-15"
elif [ "$fenc" = "UTF-8" ]; then
echo "File already is in UTF-8 encoding."
continue
elif [ "$fenc" = "" ]; then
echo "Something wong (FENC: $fenc)."
break
elif [ "$fenc" = "Non-ISO" ]; then
echo "Something wong (FENC: $fenc)."
break
elif [ "$fenc" = "MAC-CENTRALEUROPE" ]; then
fenc="MACCENTRALEUROPE"
fi

if [ ! -f "$fn" ]; then

echo "No valid file specified."
break

fi

iconv -f "$fenc" -t "$tenc" "$fn" > "${fn%/*}/temp.file" 2>&1
wait

if [ -f "${fn%/*}/temp.file" ]; then
mv "${fn%/*}/temp.file" "$fn"
fi

done
Make it executable with:
(sudo) chmod +x enco.sh

Usage:

enco.sh /path/to/file.srt
enco.sh file.srt

do your worst with it.

Return to “General talk”

Who is online

Users browsing this forum: Amazon [Bot] and 43 guests