| ||||||||||||
![]() |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
(#1)
|
| New Member Posts: 1 Join Date: Feb 2008 | Some encoding problems (and solutions) -
15-02-2008, 06:24 PM
Hello, everyone! Our company recently purchased (or leased, who knows) one of your products recently and we had major problems with incoming e-mails displayed incorrectly right away. That gave me a chance to entertain myself by fixing them, so now I'm sharing the problems with the developers, who, hopefully, might include the fixes in future versions (unless the errors have already been fixed without me noticing). 1) Encoding detection doesn't work in all cases. Encoding is being detected with this ereg: eregi('([^=]*)="(.*)"',$v,$reg); (works on Content-Type: text/plain; charset="utf-8") However, it doesn't include all cases, like, when encoding isn't wrapped in quotes (Content-Type: text/plain; charset=utf-8) Fix it by comparing the string to '([^=]*)=([^ ]*)' or something alike when $reg is empty on first ereg. File: includes/functions_parsercore.php 2) Some encodings are not supported by mbstrings (even though their aliases are). Mbstrings supports charsets listed here: PHP: Multibyte String - Manual ("Supported Character Encodings"). Notice, that "windows-1257" is not in the list but "ISO-8859-13" is. It is in fact the same encoding. Fix: Find out all the places where message charset is being detected (yes, there are several!) and simply convert mbstrings incompatible charsets to corresponding mbstrings compatible charsets (eg if(strtolower($charset) == 'windows-1257') $charset='iso-8859-13'; ). File: includes/functions_mime.php, includes/functions_parsercore.php; maybe more. |
| | |
![]() |
| Tags |
| encoding, solutions |
| Thread Tools | Search this Thread |
| Display Modes | |
| |