You are required to be a member to post replies. After logging in or becoming a member, you will be redirected back to this page.



Posted as a reply to:

Re: Hex to string

KAKA schrieb:


Actually you seem to try to convert wide char key codes (UTF-16)
of little endian notation into a string.

Try this one, which does not rely on padding '00':


WScript.Echo Hex2String("4D006F006E00690074006F0072")

Function Hex2String(s)
Dim i, c
For i = 1 To Len(s) Step 4
c = c & ChrW(CLng("&H" & Mid(s,i+2,2) & Mid(s,i,2)))
Next
Hex2String = c
End Function


Note that you can rely on a pattern with double-nulls in every 3rd and
4th position as long as the string is fully UTF-8-compatible
(no keycode > 255 / FF00)

Also, as for chars from 128-255, you'd probably need some
remapping from UTF-8 to ASCII.



MfG,
Alex





MfG,
Alex

EggHeadCafe - Software Developer Portal of Choice
WCF Workflow Services Using External Data Exchange
http://www.eggheadcafe.com/tutorials...vices-usi.aspx