Created
January 17, 2016 15:07
-
-
Save QROkes/c713e2ed0f124c79010f to your computer and use it in GitHub Desktop.
Convert Unicode Escape Sequences to UTF-8.
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
// Convert Unicode Escape Sequences to UTF-8. | |
$content = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function ($match) { | |
return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); | |
}, $content); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment