php - Conversion of mixed ASCII string with multi-byte sequences to proper UTF-8 -


please consider following ascii string comes in csv file:

foo\xe2\x80\x99s bar 

using php, how can 1 reliably convert utf-8 value is:

foo’s bar 

if string value printed foo\xe2\x80\x99s bar, in php string can defined this

$str = "foo\\xe2\\x80\\x99s bar"; 

you can string printed foo’s bar using eval() method.

eval("\$value = \"foo\\xe2\\x80\\x99s bar\";"); echo $value; 

the result display foo’s bar.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -