Thread: Unicode
View Single Post
Old 1st October 2007, 07:48   #20
jimpark
Senior Member
 
Join Date: Sep 2007
Posts: 204
The only change made to System is that all the calls default to Unicode strings rather than ANSI strings. So for example, if you specified MessageBox(...), then it will actualyl call MessageBoxW(...). As long as you provide the right function signature, then the System will work as you expect. I just had to rework some of the interfacing back and forth through the NSIS global stack but using it should be the same.

You WANT to use the Unicode functions by default because while it will automatically convert Unicode strings to ANSI codepage and back when you call ANSI functions, you may actually lose vital information or get bad behavior if the user's computer's code page setting is different from what you'd expect. And definitely things will not work if you are trying to provide an installer for a Unicode only language.

If you are converting your script from the ANSI NSIS to Unicode, and you are using the System plugin, look for functions that are ANSI only. Most of these end in "A". Change them to use Unicode. Or just specify their "TCHAR" versions -- i.e. MessageBox instead of MessageBoxW or MessageBoxA. Then the correct one will be picked up by your NSIS installer.

Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source.
jimpark is offline   Reply With Quote