i get a reply from python server basically what i am doing is sending an article and the python code is sending me important tags in the article. the reply i get is like this
"keywords": "[u'Smartphone', u'Abmessung', u'Geh\xe4userand']"
so i want to utf8 decode the Geh\xe4userand string. i read in some post that i have to put it in "" and do the decoding but its not working. my code is
$tags = str_replace("'",'"',$tags);
$tags = preg_replace('/\[*\s*u(".*?")\]*/', "$1", $tags);
$tags = explode(',', $tags);
foreach ($tags as $tag) {
pr(utf8_encode($tag));
}
die;
the output i am getting is
<pre>"Smartphone"</pre><pre>"Abmessung"</pre><pre>"Geh\xe4userand"</pre>
i don't have access to the python code.
\xe4character sequence encodes the codepoint U+00E4, but it is 4 literal ASCII characters.\xhh2-hex codes to map them to Latin-1 codepoints instead. Any\uhhhh4-hex codes are Unicode code points,\Uhhhhhhhh8-hex codepoints for Unicode codepoints outside the BMP, and then there are the\n,\rand\tescape codes for newline, carriage return and tab.