Old 6th February 2019, 12:51   #1
BerndS
Junior Member
 
Join Date: Feb 2019
Posts: 4
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:
code:
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:
Quote:
Type something here... Some Umlauts: ÄÖÄÜöäöäß
instead of
Quote:
Type something here... Some Umlauts: ÄÖÄÜöäöäß
Did I do something wrong or is there a problem with unicode characters and the nsDialog plugin?

Regards
Bernd
BerndS is offline   Reply With Quote
Old 6th February 2019, 13:51   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,013
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th February 2019, 12:55   #3
BerndS
Junior Member
 
Join Date: Feb 2019
Posts: 4
HI
Great this was the missing information.
Now it works.

Thank you Anders


Have a nice day
Bernd
BerndS is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump