Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想制作一个要utf8编码的字符串,但我不知道它的原始字符集是什么。
utf8
字符串的原始字符集可能是GBK,iso-8859-1或其他我不知道的字符集。
GBK
iso-8859-1
我使用mb_detect_encoding($content, 'UTF-8', true)和iconv($original, "UTF-8", $content);
mb_detect_encoding($content, 'UTF-8', true)
iconv($original, "UTF-8", $content);
如何获得原始编码?
我认为这可能有用http://php.net/manual/en/function.utf8-encode.php