<?php
$ss = "\u{DF}";
var_dump(urlencode($ss));
var_dump(urlencode(utf8_decode($ss)));
var_dump(json_encode(utf8_decode($ss)));
// U+044F CYRILLIC SMALL LETTER YA
$ya = "\u{44F}";
var_dump(urlencode($ya));
var_dump(urlencode(utf8_decode($ya)));
var_dump(json_encode(utf8_decode($ya)));
// Improperly formatted U+0041 LATIN CAPITAL LETTER A
$A = "\xC1\x81";
var_dump(urlencode($A));
var_dump(urlencode(utf8_decode($A)));
var_dump(json_encode(utf8_decode($A)));
string(6) "%C3%9F"
Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 5
string(3) "%DF"
Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 6
bool(false)
string(6) "%D1%8F"
Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 11
string(3) "%3F"
Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 12
string(3) ""?""
string(6) "%C1%81"
Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 17
string(6) "%3F%3F"
Deprecated: Function utf8_decode() is deprecated in /in/uPVK8 on line 18
string(4) ""??""
string(12) "%5Cu%7BDF%7D"
string(12) "%5Cu%7BDF%7D"
Fatal error: Call to undefined function json_encode() in /in/uPVK8 on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(12) "%5Cu%7BDF%7D"
string(12) "%5Cu%7BDF%7D"
Fatal error: Call to undefined function: json_encode() in /in/uPVK8 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
string(12) "%5Cu%7BDF%7D"
string(12) "%5Cu%7BDF%7D"
Fatal error: Call to undefined function: json_encode() in /in/uPVK8 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(12) "%5Cu%7BDF%7D"
string(12) "%5Cu%7BDF%7D"
Fatal error: Call to undefined function: json_encode() in /in/uPVK8 on line 6