Created
November 13, 2014 06:30
-
-
Save jemygraw/fe7641f435918d081670 to your computer and use it in GitHub Desktop.
php5 unicode convert raw post data to urlencoded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function replace_unicode_escape_sequence($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
} | |
function unicode_decode($str) { | |
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', 'replace_unicode_escape_sequence', $str); | |
} | |
$data="fname=jemygraw_999.png\u0026etag=FkbO_BZF_49z0j63-2i1C25QGdT3\u0026key=FkbO_BZF_49z0j63-2i1C25QGdT3\u0026exParam1=w\u0026exParam2=h\u0026exParam3=h"; | |
$data=unicode_decode($data); | |
echo $data; |
Author
jemygraw
commented
Nov 13, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment