Archive: MUI (NSIS 2.37) corrupts Japanese text


MUI (NSIS 2.37) corrupts Japanese text
I recently upgraded my installer to work with the latest version of NSIS. Most of my installers use the InstallOptions plugin and MUI so when I upgraded I used MUI instead of MUI2 and the nsDialogs plugin.

A Japanese user has reported that the text shown next to the "ReadMe" box on the FINISH page of my installer now has a spurious Yen symbol inserted into it.

My installer uses the default NSIS text for this checkbox. When I compared the standard MUI string for this checkbox in NSIS 2.37 with the string used in my old NSIS compiler (NSIS 2.22) I could find no difference.

It seems that MUI now uses the NSIS2IO function to convert the strings used on the FINISH page and this function is corrupting the Japanese text used for the MUI_TEXT_FINISH_SHOWREADME string.

I can see a "\" character when I look at this text string on my English Windows system and when I selected "Japanese" for my installer I could see an extra "\" had been inserted by NSIS 2.37 when the FINISH page was shown.

Here is a screenshot showing the problem:


MBCS fun. There's no CharNext in NSIS scripting and so NSIS2IO must convert the characters one by one which breaks up Japanese characters which are built with backslashes.


With the help of a Japanese user I tried some experiments. It seems that the problem can be solved by inserting the following code:

!define MUI_FINISHPAGE_SHOWREADME_TEXT  "$(MUI_TEXT_FINISH_SHOWREADME)"
I want to use the default text for the "ReadMe" checkbox on the FINISH page and doing it this way seems to stop MUI from using the NSIS2IO function.