request http://a.com/?q=\xC3\xA2\xB0\xED
source
$str1 = "\xC3\xA2\xB0\xED";
$str2 = '\xC3\xA2\xB0\xED';
$str3 = $_GET['q'];
echo "string1 : " . mb_detect_encoding($str1) . "<br>";
echo iconv("CP949", "UTF-8", $str1) . "<br>";
echo "string2 : " . mb_detect_encoding($str2) . "<br>";
echo iconv("CP949", "UTF-8", $str2) . "<br>";
echo "string3 : " . mb_detect_encoding($str3) . "<br>";
echo iconv("CP949", "UTF-8", $str3) . "<br>";
response
string1 : UTF-8
창고
string2 : ASCII
\xC3\xA2\xB0\xED
string3 : ASCII
\xC3\xA2\xB0\xED
$str2, $str3 decode is fail.. How can i fix it? And Why is it different.. single quote string VS double quote string
Version : PHP 7.1.30
Thanks in advance