iconv function: The requirement to convert character encoding of a string
Syntax: string
Iconv(String In_charset, String out_charset, String str)
When using this function for string encoding conversions, it is important to note that if you convert Utf-8 to gb2312, a string truncation can occur.
This can be resolved using the following methods:
$str =iconv (Utf-8, "Gb2312//translit", file_get_contents ($filepath));
That is, in the second parameter, add the Red Word section, meaning: If you cannot find a character that matches the source encoding in the target encoding, a similar character is selected for conversion.
This can also be used here://ignore This parameter, which means that characters that cannot be converted are ignored.
http://www.bkjia.com/PHPjc/486062.html www.bkjia.com true http://www.bkjia.com/PHPjc/486062.html techarticle iconv function: The requirement syntax for converting character encodings of strings: String Iconv (String in_charset, String out_charset, String str) when using this function for string encoding conversions ...