tags:

views:

27

answers:

1

Hi: I have a string encoded by Escape in VBScript:

The Escape function returns a string (in Unicode format) that contains the contents of charString. All spaces, punctuation, accented characters, and other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. Unicode characters that have a value greater than 255 are stored using the %uxxxx format http://msdn.microsoft.com/en-us/library/h3607h29%28VS.85%29.aspx.

How do i decode the string in PHP?

Thanks very much.

+1  A: 

urldecode($string)

Although this may not work properly if there are non-ASCII characters encoded in the string. There's a user-submitted note on the documentation page that provides code for a function called decode_unicode_url($str) that should do the trick if you actually have Unicode characters in the string.

David
Thanks David. urldecode() decodes Escape().A good online tool to check the results: http://coderstoolbox.net/string/
Michael Z