当前位置: 动力学知识库 > 问答 > 编程问答 >

php - How to change a string to utf8 encoded?

问题描述:

I want to make a string to utf8 encoded, but I don't know what the original charset it is.

The original charset of string may be GBK, iso-8859-1, or others I don't know.

I use mb_detect_encoding($content, 'UTF-8', true) and iconv($original, "UTF-8", $content);

How to get the original encoding ?

网友答案:

I think this is maybe useful http://php.net/manual/en/function.utf8-encode.php

分享给朋友:
您可能感兴趣的文章:
随机阅读: