Archive: Unicode build question


Unicode build question
In our NSIS script, there is a step to check that the installation directory selected contains only ANSI characters because the Amardillo DRM we are using does not support Unicode. We do this check using the following statement:

System::Call 'kernel32.dll::WideCharToMultiByte(i 437, i ${WC_NO_BEST_FIT_CHARS}, w r1, i -1, i r5, i 2048, n, n) i .r2'


This statement used to work. It'll convert what's selected in the text box to ANSI. But now it converts the text into unreadable gibberish after I upgraded to the latest version of NSIS.

I'm very not familiar with NSIS because I just took over this project not long ago. Can somebody shed some light?

Thanks.

The issue was solved on IRC and was not actually in this posted line but on the next line when the "t" system.dll type was used to extract the ansi string. The m type must be used for ansi strings since t can be ansi or unicode (Older unicode builds probably mapped t to the wrong string type)

(Also, n,n is not really correct, n is not a type, use i)