Skip to content
⌘ NSIS Forum Archive

Page Displayed Language Error

4 posts

tnteverett#

Page Displayed Language Error

Using "Unicode true", the coded language string does not display in page correctly.
For instance
sélectionné
does not display the "é" correctly. What is displayed is an "A" with tilde above and a copyright symbol.

NSIS Version 3.02.1
Windows 7 Pro

Code specifics:
; MUI ------
!include "MUI2.nsh"
Unicode true

!define MUI_WELCOMEPAGE_TITLE $(WelcomePageTitleLang)
!define MUI_WELCOMEPAGE_TEXT $(WelcomePageTextLang)
!insertmacro MUI_PAGE_WELCOME

LangString WelcomePageTitleLang ${LANG_ENGLISH} "Welcome to ${PRODUCT_NAME} ${PRODUCT_VERSION} Setup"
LangString WelcomePageTitleLang ${LANG_FRENCH} "Bienvenue dans la configuration ${PRODUCT_NAME} ${PRODUCT_VERSION}"
LangString WelcomePageTextLang ${LANG_ENGLISH} "Setup will guide you through the installation of a selected ${PRODUCT_NAME}.$\r$\n$\r$\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.$\r$\n$\r$\nClick Next to continue."
LangString WelcomePageTextLang ${LANG_FRENCH} "Le programme d'installation vous guidera lors de l'installation d'un ${PRODUCT_NAME} sélectionné. $\r$\n$\r$\nIl est recommandé de fermer toutes les autres applications avant de commencer l'installation. Cela permet de mettre à jour les fichiers système pertinents sans devoir redémarrer votre ordinateur. $\r$\n$\r$\nClicer sur Suivant pour continuer."
Anders#
What is the format of your .nsi file? You need to save in UTF-8 or UTF-16LE with BOM (Notepad just calls it Unicode).

If makensis -v4 displays something like "opening yourfile.nsi (ACP)" then it will not work, it must be Unicode.
tnteverett#
I suspected this so I changed my editor (Notepad++) to ANSI and it worked if I used "Unicode true" but then I found other error in function call return values. For example when I expected "603" I got "?3".
Notepad++ does not have "UTF-16LE" but it does have "UTF-8" but this is where I started and that was not working.
I am still confused, and still trying to resolve both issues now.
Anders#
It needs to be UTF-8 with a BOM. Notepad++ calls "UTF-16 LE BOM" "UCS-2 LE BOM" (almost the same thing). If for whatever reason you cannot use a BOM then you must use "makensis /INPUTCHARSET UTF8 yourfile.nsi"

The final alternative is to replace non-ASCII characters in the .nsi with ${U+xxxx} but that is probably too much work for langstrings.