|
|||
| Moderated by: Renate.Reinartz, Markus.Kreisel, Jaakko.Salmenius, Ilkka.Salmenius |
|
||||||||||||||||
| Chinese localization problem - Bugs and Quirks in Sisulizer - Technical Support (You need to be registered at the forum to write) - .NET, Delphi, ... - Sisulizer Localization Tool Support | |||||||||||||||||
| Author | Post | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|||||||||||||||||
|
YukonPete Member
|
I have a Delphi application using Delphi XE2. I have successfully translated the application to Chinese and it seems to run correctly. However, there is one problem. In the Sisulizer project I have an ini file that contains strings. In Sisulizer the translations for this ini file appear correctly. However, when I build the ini file in the project and open the ini file, the translations appear as garbage (I am sure there is a word for the "garbage", but I can't remember it). I could cut and paste the correct translations from Sisulizer to the ini file, but obviously there is something I am not aware of. Thanks, Lee
|
||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|
Ilkka.Salmenius Administrator
|
These garbage characters are called mojibake http://en.wikipedia.org/wiki/Mojibake Your INI files are fine, even the Chinese file. The reason for the mojibake is that the original INI file is not Unicode but uses Ansi strings (e.g. code page encoded single byte characters). Internally Sisulizer handles eveything in Unicode and that's why all characters and translations show correctly inside Sisulizer. However when Sisulizer creates localized files it must deside what encoding to use. There are dozen of available encoding for text file: Ansi 1252, Ansi 1251, UTF-8, UTF-16, various ISO encodings, etc. What Sisulizer does it that is uses the same encoding as the origihnal file. If the encoding of the origihnal files can not support the target language then it uses a matching encoding. In your case the original encoding is Ansi 1252 (Windows Western). It does not support Chinese so Ansi 936 (Simplified Chinese) is used instead. If you open an INI file that uses Ansi encoding Notepad (or the editor you use) assumes that the Ansi encoding is the default Ansi encoding of your computer (in your case it is 1252). This causes mojibake. If you turn the default code page of your computer to Chinese from Regional Settings of Control Panel, reboot and open Chinese again it will show correctly. This is because the system code page will now be 936. Your current file most like works just OK if run on Chinese PC. Another solution would be that you change the encoding of your INI files from Ansi to Unicode. This way the localized INI files would also be in Unicode and no mojibake will appear. A third solution (not recommanded) is that you change the output encoding from default one to Unicode. This what your original INI will stay in Ansi but localized would be UTF-8. This removes mojibake but might break your code that assumes that INI file uses Ansi. You can change output encoding by selecting INI file in the project tree, right clicking Properties and editing the encoding in the Encoding sheet. See the screenshot. Ilkka Attachment: Untitled.png (Downloaded 8 times)
____________________ http://www.sisulizer.com - Three simple steps to localize |
||||||||||||||||
| |||||||||||||||||
|
|||||||||||||||||
|
YukonPete Member
|
Thank you for the detailed explanation. Lee
|
||||||||||||||||
| |||||||||||||||||
| Current time is 09:47 am | |
| .NET, Delphi, ... - Sisulizer Localization Tool Support > Technical Support (You need to be registered at the forum to write) > Bugs and Quirks in Sisulizer > Chinese localization problem | |
Sisulizer software localization tool - Three simple steps to localize