View Single Post
Old 20th July 2014, 14:13   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,454
Quote:
!define EMPTY ""
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
If you need to deal with things outside the ASCII range in a specific codepage you should call MultiByteToWideChar...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote