Page 1 of 1

[Solved] ITT: Encoding of .lng unstable, when in UTF-8

Posted: 09 Jan 2013 16:13
by Borut
Some time ago I have re-encoded (via a third party editor) the .lng file I am being creating while translating into UTF-8. My rationale behind that: It is smaller for the future downloads and - as far as I remembered - this was defined as being supported. And so it was -no problems ever since.

However, today (with v11.90.0202) I came upon the wild idea to update it with a reference file 8.14, although there was no need for this (apart that I was expecting 8.15 to come up with v11.90.0202), since my .lng was already on the 8.14 level.

Well, the UTF-8 encoded characters appear to become destroyed with this procedure, so that after saving the .lng it is rendered pretty much useless. The backup is the only help (and I was on the safe side).

So, in short, special circumstances were:
1) .lng encoded in UTF-8 instead of the standard UTF-16;
2) unnecessary update of the .lng, which was already on the last available level.

Maybe it would be worth investigating this, although very special circumstances ware apparently necessary.

Re: ITT: Encoding of .lng, while searching for trouble

Posted: 09 Jan 2013 16:40
by admin
I guess this is related to the recently fixed bug:

Code: Select all

    ! UTF8: UTF8 encoding and decoding (incl. SC utf8encode and 
      utf8decode) was potentially affected by the active codepage: The 
      results were not always correct when the active codepage was 
      different from 1252 (ANSI - Latin I). Fixed. The fix handles all 
      places where UTF8 is encoded or decoded.

Re: ITT: Encoding of .lng, while searching for trouble

Posted: 09 Jan 2013 16:52
by Borut
Maybe. I have done some further testing in the meantime: It seems that it suffices to simply change anything in the translation and save - that seems to destroy the UTF-8 encoding of the non ASCII characters.

So, in my view, either the support of UTF-8 in .lng should be abandoned officially, or this negative side effect corrected.

Edit: Further details about my place:
System Locale ID: 1050
Thread Locale ID: 3079
Default ANSI Code Page: 1252
Active Code Page: 1250 (ANSI - Mitteleuropa)

Re: ITT: Encoding of .lng unstable, when encoded in UTF-8

Posted: 09 Jan 2013 21:43
by admin
Got it. :twisted: The error was not in the UTF-8 conversion (which indeed got correctly fixed) but in the file writing. The bytes got obviously mangled at one point. Fix comes.

Good bug!

Re: ITT: Encoding of .lng unstable, when encoded in UTF-8

Posted: 09 Jan 2013 22:00
by Filehero
admin wrote:Good bug!
You mean good bug hunter, right? :wink:


Cheers,
Filehero