![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Your Hex2String script 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 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Logon Script Causing Laptops To Hang - Problems in script? | VB Script | |||
| problem passing args to script 'There is no script engine for file extenstion' | VB Script | |||
| Include another script, keep variables in included script? | PowerShell | |||
| Script file has 'OS Handle' error when run from script | PowerShell | |||
| Can you drag-n-drop a file on top of a PS script to run the script? | PowerShell | |||