utf 8 - How to convert Windows-1252 characters to values in php? -
we have several database fields contain windows-1252 characters:
an example pain— if you’re
those values map desired values list:
http://www.i18nqa.com/debug/utf8-debug.html
i've tried various permutations of htmlentites, mb_detect_encoding, uft8_decode, etc, have not yet been able transform values to:
an example pain — if you're
how can transform these characters listed values in php?
you can use mb_convert_encoding
$str = "an example pain— if you’re"; $str = mb_convert_encoding($str, "windows-1252", "utf-8"); echo $str; //an example pain— if you’re
demo:
http://ideone.com/nsib5x
Comments
Post a Comment