Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 29th August 2006, 12:49   #1
kookh
Junior Member
 
Join Date: Apr 2006
Posts: 37
Return unicode of a character

Is there a function in NSIS that can return the unicode of a certain character? Something similar to charCodeAt() in JavaScript?
kookh is offline   Reply With Quote
Old 29th August 2006, 12:56   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
You can use the System plug-in to convert strings into Unicode. There are many ways to do that, even with that plug-in. If you provide a little more details about what exactly you're trying to do, I can show you the best solution for the problem.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th August 2006, 13:01   #3
kookh
Junior Member
 
Join Date: Apr 2006
Posts: 37
Edit: I just need to loop on every character in a string, obtain its unicode value, and do some operation on it.
kookh is offline   Reply With Quote
Old 29th August 2006, 13:13   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,336
Build a Unicode string and read it 2 bytes at a time.
code:
System::Call "*(&w1024 'hello')i.r0"
StrCpy $1 $0
System::Call "*$0(&i2.r2)"
${While} $2 != 0
DetailPrint $2
IntOp $0 $0 + 2
System::Call "*$0(&i2.r2)"
${EndWhile}
System::Free $1


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 29th August 2006, 13:20   #5
kookh
Junior Member
 
Join Date: Apr 2006
Posts: 37
Excellent... Exactly what I needed. Thank you!
kookh is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump