decode string encoded by Escape()(a method in VBScript) in php
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. U开发者_运维知识库nicode 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?
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.
精彩评论