Fix ‘weird’ characters in movie subtitles with one command!
Can you name one thing that is more frustrating than weird characters in movie subtitles? It’s a common thing in languages with accented letters (Croatian e.g.). Even though you can watch the movie and understand, it’s annoying!
Problem lays within the subtitle file (.srt, .sub) that is differently encoded and the quick fix is to encode it to the universal UTF8 encoding.
When I was younger I used to open subtitle file and do find-and-replace on weird characters in order to fix it :). However, there is a much better way to do this.
Open your terminal (I am using Ubuntu 16.04) and navigate to the directory with your subtitles. Execute this command:
$ enconv -x utf8 -L hr Subtitle_File.srt
and reload the subtitles in the player.
For example, I run
$ enconv -x utf8 -L hr Person.of.Interest.S01E01.srt
but you can use a wildcard to fix more subtitle files at once
$ enconv -x utf8 -L hr *.srt
So what does this
enconv command that I told you to run actually do? By reading the documentation we find this explanation:
Detect encoding of text files and convert them if required. Arguments -x and -L define wanted encoding and language of input file. Refer to manual of
enconv in order to find out more about usage.
Enjoy your movie!
Originally published at itworkslocal.ly on January 6, 2016.