简体   繁体   中英

how to use only unicode in nsis?

I am evaluating nsis. I want to create an installer (using mui2) which will use the provided Unicode strings (for titles, buttons, labels etc.) and not to use any "localization".

For example: the application title contains unicode characters from different languages (let's say: " Λεξικό-Dictionary-Речник " will be the whole title, regardless of the user "language")

Is there a simple way to use the provided exact unicode strings independently of the mui language?

EDIT (as commented) : The above is about having own Unicode strings for buttons and, in general, UI text (no localization). Is not about any source (or destination) "filename" or "path".

NSIS will not translate the name, just make sure you save the .NSI source file as UTF-8 with BOM /Signature or UTF-16 with a BOM if you use non-ASCII characters.

Unicode True
Name "Λεξικό-Dictionary-Речник"
OutFile "MyInstaller.exe"
InstallDir "$ProgramFiles\$(^Name)"

!include MUI2.nsh

!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE English

Section
SetOutPath $InstDir
File /r "c:\myfiles\*.*"
SectionEnd

It is also possible to manually construct Unicode characters from Unicode code points:

Section
MessageBox MB_OK "${U+2115}SIS" # DOUBLE-STRUCK CAPITAL N + "SIS"
SectionEnd

The problem was I saved the file as UTF8 (!!!). After saving the file from Notepad as Unicode the problem disappeared.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM