PHP code conversion minus signs (connectors) cannot be converted. PHP code conversion minus signs (connectors) cannot be converted.
Maybe yes, published on
Use PHP's iconv or mb_convert_encoding function for encoding conversion. for example, to convert gb2312 to UTF-8 encoding, some special characters (minus signs, connectors) may not work properly, it may become a question mark "? "Or" C ". I tried multiple methods and still cannot solve this problem well. The following code indicates that the connection symbol "-" still becomes a symbol "after the // IGNORE is declared "? ".
According to the solution provided by netizens in the PHP Official Manual, the problem still cannot be solved. I don't know if it is my local PHP version.
Solution 1:
Please note that iconv ('utf-8', 'ascii // Transcoder ',...) doesn't work properly when locale category LC_CTYPE is set to C or POSIX. you must choose another locale otherwise all non-ASCII characters will be replaced with question marks. it is at least true with glibc 2.5.
Example:
[Translation]
Note that iconv cannot work normally when the language environment class LC_CTYPE is set to C or POSIX. You must select another language. otherwise, all non-ASCLL codes will be replaced with question marks "? ". This problem is true under glibc 2.5.
Example:
Solution 2:
That will strip invalid characters from UTF-8 strings (so that you can insert it into a database, etc .). instead of "none" you can also use the value 32 if you want it to insert spaces in place of the invalid characters.
Read (75) comment (0) view comment