Source Code:
(back to article)
<?php // Define a string in Unicode escape sequence $unicode_string = "\u00e7af\u00e9 au lait"; // Convert the string from Unicode escape sequence to UTF-8 encoding $utf8_string = json_decode('"' . $unicode_string . '"'); // Convert the UTF-8 string to ISO-8859-1 encoding $iso_string = mb_convert_encoding($utf8_string, "ISO-8859-1", "UTF-8"); // Convert the ISO-8859-1 string back to UTF-8 encoding $utf8_string = mb_convert_encoding($iso_string, "UTF-8", "ISO-8859-1"); // Output the result echo $utf8_string; // Output: "çafé au lait"
Result:
Report an issue