The problem is to convert string into Unicode form UCS-2LE, here the sample.
input: 12345
output UCS2-LE string of bytes: 31003200330034003500
Any idea how to solve it?
How to convert string to UCS-2LE
4 posts
First of all, NSIS Unicode 2.46.5 is a fork of the official package, so we can't provide any support for it.
Try the latest NSIS 3.x release, as the NSIS 3.x releases support both ansi and unicode. To compile a unicode installer, use 'Unicode True'. Put the string into the script and the compiler should convert it for you.
Try the latest NSIS 3.x release, as the NSIS 3.x releases support both ansi and unicode. To compile a unicode installer, use 'Unicode True'. Put the string into the script and the compiler should convert it for you.
Hello I assume the question do not correlate with NSIS version
!define EMPTY ""If you need to deal with things outside the ASCII range in a specific codepage you should call MultiByteToWideChar...
StrCpy $0 "12345"
StrCpy $1 0
StrCpy $2 ""
loop:
StrCpy $3 $0 1 $1
StrCmp "" $3 done
System::Call 'kernel32::lstrcpyW(*i.r4,wr3)'
IntFmt $4 %x $4
StrLen $3 $4
IntCmp $3 4 +3
StrCpy $4 $4${EMPTY}0
Goto -3
StrCpy $2 $2$4
IntOp $1 $1 + 1
Goto loop
done:
DetailPrint $2