You are not logged in.

#1 2013-11-29 07:57:40

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Strange problem with local characters not being displayed...

... or even saved in text files that are downloaded.

I have my system in English, but occasionally I download subtitles for movies in Polish or Serbian. When I do so, the extracted .srt file has most of the local characters scrambled.

Here's an example:

The text that should read

Mam dla pani wiadomość.

in the downloaded subtitles files appears as

Mam dla pani wiadomoϾ.

And it stays like that even if I open it in Windows, which has no such problems because on windows I can download the very same file and the letters are correct.


The strange thing is that my system displays those characters with no problems when I browse a website, or even type them myself.

Does anyone have an idea how to solve that?

Offline

#2 2013-11-29 08:08:55

Gulver
Member
Registered: 2013-05-24
Posts: 208

Re: Strange problem with local characters not being displayed...

It might be the font is not supporting such characters, if not it's a good idea to check your locale, ISO and UTF differences can be the problem.

Offline

#3 2013-11-29 08:14:59

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Strange problem with local characters not being displayed...

1. I don't think it is the font problem, because if the file is downloaded in linux, the characters stay screwed up even when I open the file in LibreOffice (which always support them) or in Windows.
2. my locale is this

$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

and the only locales uncommented are en_GB.UTF-8 and pl_PL.UTF-8

Offline

#4 2013-11-29 08:21:20

Gulver
Member
Registered: 2013-05-24
Posts: 208

Re: Strange problem with local characters not being displayed...

Why don't you just rerun a locale-gen and make sure of it. Btw while almost all of the softwares are US based, why are you using GB? Not even British people does that. I had the same problem and solved after changing the vlc options with different fonts.

VLC > Preferences > OSD/Subtitiles > Default encoding = Polish.

Offline

#5 2013-11-29 08:36:14

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Strange problem with local characters not being displayed...

>>>>> Why don't you just rerun a locale-gen and make sure of it.
I did rerun it.

>>>>> Btw while almost all of the softwares are US based, why are you using GB? Not even British people does that.
Does that have any negative impact? I don't like americaniZZZZZed "s" in words.


>>>>>  I had the same problem and solved after changing the vlc options with different fonts.
Problem is program- and font-independent

Offline

#6 2013-11-29 08:52:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Strange problem with local characters not being displayed...

What's the output of 'file <subtitles file>'? it might be using Windows code page, so you have to convert it.
https://wiki.archlinux.org/index.php/Co … s_encoding

Offline

#7 2013-11-29 09:49:40

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Strange problem with local characters not being displayed...

It is:
Non-ISO extended-ASCII text, with CRLF line terminators

Offline

#8 2013-11-29 09:55:40

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Strange problem with local characters not being displayed...

Try something like 'iconv -f CP1250 -t UTF-8 INFILE > OUTFILE'.
https://en.wikipedia.org/wiki/Windows-1250

Offline

#9 2013-11-29 10:13:00

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: Strange problem with local characters not being displayed...

Yeah, that did the trick. But is there something I can do to avoid the problem altogether?
I have been using this system for years and it only started happening weeks ago.

Offline

#10 2013-11-29 10:20:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Strange problem with local characters not being displayed...

If these subtitles (or any other text files) have been created on Windows, they will have Windows codepage and not some iso encoding.

If you have the old files that worked w/o converting, see if they still work and check what's the output of 'file <filename>' for them.

Offline

Board footer

Powered by FluxBB