Archive: LangString and SimpChinese

LangString and SimpChinese
I have a (MUI2) NSI script for an installer which pops up a MessageBox in the main install section. I have the MUI_LANGUAGE macros for English and SimpChinese and have also defined LangStrings for the message label in the MessageBox (one each for English and SimpChinese).

The SimpChinese LangString text is in Chinese - the actual characters are visible/readable in the NSI file (which is saved in UTF8).

When I run the installer on English Windows, all is well. When I run the installer on Chinese Windows, not so. Despite choosing Simplified Chinese in the language chooser dialog (Simplified Chinese is selected by default), the label in the MessageBox is not the Chinese text I specified in the script - it is garbled/corrupted. The OK button is in Chinese however.

If I build the same script with Unicode NSIS from, the label is in correct Chinese.

My question: Should NSIS be able to show the label correctly or am I getting the "expected" result (and my only option is to use Unicode NSIS)?

Thanks in advance,


With NSIS (Official ANSI) <= 2.46 you should not use UTF8 source files.

The actual raw byte values in the file need to be correct so you have to change the encoding/codepage in your text editor and then input the text. If you need to support many different languages you need to be careful so your editor does not mess up the other languages, or use one .nsh per language for LangStrings.

As a final note, ANSI installers will only show the correct text if the codepage for non-unicode programs in the control panel is set correctly...

Thanks Anders.

I did originally try all the encoding types (in Notepad) and got the same result as UTF8.

If I understand what you're saying, I'd need to run Notepad on a computer which runs the language which I want to add...which is impractical for me (given I want to build on Linux as much as possible).

I guess I'll use scratchpaper for now and look forward to the release of NSIS 3, assuming it will have Unicode goodness...and there will be a Linux build too!

...or just use a better editor, Notepad2 etc that can save in a specific encoding.

On *nix you can probably use iconv on the command line to change from utf8 to the correct codepage.