Kayako logo
SupportSuite, eSupport and LiveResponse Discussion, troubleshooting and feedback related to Kayako's flagship support desk products SupportSuite, eSupport and LiveResponse.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1) Old
kaitnieks Offline
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.
   
Reply With Quote
Reply

Tags
encoding, solutions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46