Skip to content
⌘ NSIS Forum Archive

${StrRep} and Unicode

5 posts

alexmitev#

${StrRep} and Unicode

Hello,
I'm using the code for the ${StrRep} function taken from http://nsis.sourceforge.net/StrRep in a separate nsh file.
The problem is, when I use
Unicode true
I get error
Can't change target charset after data already got compressed or header already changed!
I see the function is doing nothing special. How can I resolve this issue?

Regards,
Alex
alexmitev#
Yes, this is obvious, but I was looking for a more elegant solution. How can several Exch and Push commands mess up compression?
Anders#
Once you start adding code to a section/function the Unicode mode is locked. Technically I believe you can do Push "" etc. but once a non-empty string is used the mode is locked.

You must put code in a macro if you want to delay something.
alexmitev#
Yes, you're right, even this code produces the error:

Function blah
Push $R0
FunctionEnd
Unicode true
even if I use the function at a much later state...