10

I'm using NSIS to generate a Windows' installer for my application. I'd like a multi-lingual installer. I'm using LangString for specifying strings.

However, the documentation doesn't seem to say how one should encode a non-ASCII character. For example, to use the German word "benötigt" (where the 'o' has an umlaut), how should I encode the ö?

4 Answers 4

3

It's just easier to use the Unicode version of NSIS. The entire problem then goes away.

Sign up to request clarification or add additional context in comments.

Comments

3

If you want to compile the UNICODE strings by the ANSI version of NSIS compiler, then you have to put such strings in separate .nsi file with UCS-2 LE BOM (lookup it with Notepad++) format and directly include that.

I've using particularly english and russian versions of such files at the end of a main.nsi:

!ifdef LANG_ENGLISH !include "${PROJECT_SRCS_ROOT}\lang_en.nsi" !endif !ifdef LANG_RUSSIAN !include "${PROJECT_SRCS_ROOT}\lang_ru.nsi" !endif 

1 Comment

It worked for me. However, the Code in my Notepad++ version was called UTF-16 LE BOM. Worked fine - thank You!
2

I assume we are talking about the ANSI version of NSIS here...

The 2nd parameter to LangString is the language id (You can generate one with NSIS\Bin\MakeLangId.exe, but since you probably already use the MUI_LANGUAGE macro or LoadLanguageFile, ${LANG_GERMAN} etc will be defined for you)

NSIS does not really care how the string is encoded, but if you have a lot of strings in different languages, it is probably a good idea to put the LangString commands in external files that you can !include. This way you can edit different language files with different codepages and text editors.

9 Comments

NSIS has been standardized by ANSI? That aside, how can it not care about the encoding? It has to display the text on-screen. It must assume some encoding. ISO-8859-1? UTF-8? Can the encoding be specified? If so, how?
No, ANSI like windows 9x is ANSI and not Unicode. NSIS does not display anything, windows does, NSIS just gives it a char*.
OK, so how do you tell Windows what the character encoding is?
In the control panel regional options, there is a combobox to set the codepage for ansi programs. The NSIS language selection dialog tries to only display languages that would "work"
NSIS correctly displays it's own boiler-plate text, but it currently does not display mine correctly. A ü (small letter 'u' with an umlaut) displays as ü (a capital letter 'A' with a tilde followed by a 1/4 fraction). The byte value of the ü is 0xFC. That obviously doesn't work. What value(s) should replace the 0cFC?
|
0

if you can not use the unicode version of nsis, you could encode your text in latin-1 (ISO 8859-1) which can be used to produce these umlauts as ü,ä,ö

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.