Why this line of code: returns “ยค” instead of “ค”? also returns false instead of “ม”. Answer After all your helps I’ve got to this result:
Tag: iconv
PHP, convert UTF-8 to ASCII 8-bit
I’m trying to convert a string from UTF-8 to ASCII 8-bit by using the iconv function. The string is meant to be imported into an accounting software (some basic instructions parsed accordingly to SIE standards). What I’m running now: This works for accounting software #1, but software #2 complains about the encoding. Specified encoding by the standard is: IBM PC
iconv – Detected an illegal character in input string
I don’t see anything illegal – any suggestions on what might be the problem? if (strtolower($matches[1]) != ‘utf-8’) { var_dump($matches[1]); $xml = iconv($matches[1], ‘utf-8’, $…
How can I detect a malformed UTF-8 string in PHP?
The iconv function sometimes gives me an error: Is there a way to detect that there are illegal characters in a UTF-8 string before sending data to inconv()? Answer First, note that it is not possible to detect whether text belongs to a specific undesired encoding. You can only check whether a string is valid in a given encoding. You