Skip to content
⌘ NSIS Forum Archive

Problems with Umlauts and nsDialog

3 posts

BerndS#

Problems with Umlauts and nsDialog

Hi

As it seems there ist a problem with Umlauts (and maybe other language specific unicode characters) when creating a custom dialog with NSIS 3.
It looks like all characters are printed out as ANSI chars.
Here is some code I used for testing:
Unicode true

!include nsDialogs.nsh
!include LogicLib.nsh

Name nsDialogs
OutFile nsDialogs.exe

Var Dialog
Var Text
!include "includes\nsDialogs_createTextMultiline.nsh"

Page custom nsDialogsPage
; !insertmacro MUI_PAGE_INSTFILES

Function nsDialogsPage
nsDialogs::Create 1018
SetCtlColors $HWNDPARENT 0 0xF9BA00
FindWindow $0 "#32770" "" $HWNDPARENT
SetCtlColors $0 0 0xF9BA00 ;inneres Fenster: Hintergrund Honig
Pop $Dialog

${If} $Dialog == error
Abort
${EndIf}
${NSD_CreateText} 0 13u 100% -13u "Type something here... Some Umlauts: ÄÖÄÜöäöäß"
Pop $Text

SetCtlColors $Text 0 0xF9BA00
nsDialogs::Show
FunctionEnd
Output looks like this:
Type something here... Some Umlauts: ÄÖÄÜöäöäß
instead of
Type something here... Some Umlauts: ÄÖÄÜöäöäß
Did I do something wrong or is there a problem with unicode characters and the nsDialog plugin?

Regards
Bernd
Anders#
Try saving your .nsi as UTF-8 with a BOM (or UTF-16 with BOM).

A UTF-8 encoded file (without BOM) when interpreted as ANSI will display "ÄÖÄÜöäöäß".

Alternatively you can force it to parse the source as UTF-8: makensis /INPUTCHARSET UTF8 myfile.nsi
BerndS#
HI
Great this was the missing information.
Now it works.

Thank you Anders


Have a nice day
Bernd