Thread: Unicode
View Single Post
Old 15th September 2007, 13:23   #2
Senior Member
Join Date: Sep 2007
Posts: 204
Thanks for posting that kichik.

A few things to note. The Unicode NSIS installer is COMPLETELY Unicode. This means that your NSI script must also be Unicode (UTF-16LE). This can easily be done by using Notepad. Just change the encoding to "Unicode" and that will do it.

Note that the plugins you may be relying on will not work unless they are also built with Unicode in mind. This means that the access to the global stack that is used to transmit information back and forth from plugin to NSIS must contain Unicode (wchar_t) strings.

*** Developers ***
If you are a plugin author, it shouldn't be too difficult to make the changes. You can take a look at what I did for the standard plugins that ship with NSIS. The source is here:

If you look at ExDLL, you will notice new functions that will help you with the translation of the stack as well. For instance, if you DLL only cares about ASCII codesets, then you may not need to do much modifications at all. It just needs to call the new functions that automatically translate the stack's strings from Unicode to ANSI and ANSI to Unicode. But most likely, if you are dealing with user entered strings, you will need to make your DLL completely Unicode aware as well.

The source uses TCHARs so you can target building both ANSI and Unicode versions of NSIS. It is based on NSIS 2.29 with some bug fixes and minor tweaks. If you are interested, the ANSI version of the binary built with the same source code is also here:

Please look at the tracker submission for more information about building the source yourself. I developed on VS2005 and I would be surprised if it builds on the other platforms. Even if they do, I did not change the SCONS config files for the other platforms to define _UNICODE and UNICODE which is what's needed for the source to be built as Unicode.

Unicode NSIS advocate -- for latest build and source.
jimpark is offline   Reply With Quote