UC_Ticket could not fetch correct email with unicode characters at subject. It returns something like: =?UTF-8?Q?_ho=E1=BA=B7c_v=E1=BB=81?= =?UTF-8?Q?_]_N=E1=BB=99i_dung_th=E1=BB=AD?=
UC_Ticket could not fetch correct email with unicode characters at subject. It returns something like: =?UTF-8?Q?_ho=E1=BA=B7c_v=E1=BB=81?= =?UTF-8?Q?_]_N=E1=BB=99i_dung_th=E1=BB=AD?=
Comments
Comment #1
Anonymous (not verified) commentedHmm, haven't seen this one yet. I'll try to reproduce it and see what's going on.
Comment #2
Nguyen DO commentedAh, i am fetching emails from a Gmail account
Comment #3
mariano.barcia commentedSame thing happening to me. How to fix? Thanks.
Comment #4
mariano.barcia commentedOk I fixed this by making use of the imap_mime_header_decode() function.
Will be testing it. Differences pasted inline here (sorry, don't have SSH access now).
***** C:\DOCUME~1\ADMINI~1\TEMP\SCP23687\PUBLIC_HTML\SITES\ALL\MODULES\UC_TICK
\uc_ticket.module
388: //first we look for ticket number in the subject
389: $subject_element = imap_mime_header_decode($header->subject);
390: $subject = $subject_element[0]->text;
391: preg_match_all('/\[T#([0-9]*)\]/', $subject, $matches);
***** C:\DOCUMENTS AND SETTINGS\ADMINISTRADOR\MIS DOCUMENTOS\DOWNLOADS\UC_TICK
-6.X-1.0-BETA6\UC_TICKET\UC_TICKET.MODULE
388: //first we look for ticket number in the subject
389: $subject = $header->subject;
390: preg_match_all('/\[T#([0-9]*)\]/', $subject, $matches);
***** C:\DOCUME~1\ADMINI~1\TEMP\SCP23687\PUBLIC_HTML\SITES\ALL\MODULES\UC_TICKE
\uc_ticket.module
427: //find out if we need to associate this ticket with an order
428: $subject_element = imap_mime_header_decode($header->subject);
429: $subject = $subject_element[0]->text;
430: preg_match_all('/\[O#([0-9]*)\]/', $subject, $matches);
***** C:\DOCUMENTS AND SETTINGS\ADMINISTRADOR\MIS DOCUMENTOS\DOWNLOADS\UC_TICKE
-6.X-1.0-BETA6\UC_TICKET\UC_TICKET.MODULE
426: //find out if we need to associate this ticket with an order
427: $subject = $header->subject;
428: preg_match_all('/\[O#([0-9]*)\]/', $subject, $matches);
***** C:\DOCUME~1\ADMINI~1\TEMP\SCP23687\PUBLIC_HTML\SITES\ALL\MODULES\UC_TICKE
\uc_ticket.module
476:
477: $subject_element = imap_mime_header_decode($header->subject);
478: $subject = $subject_element[0]->text;
479: $subject = preg_replace('`\[[^\]]*\]`', '', $subject);
480: if (is_array($header->from)) {
***** C:\DOCUMENTS AND SETTINGS\ADMINISTRADOR\MIS DOCUMENTOS\DOWNLOADS\UC_TICKE
-6.X-1.0-BETA6\UC_TICKET\UC_TICKET.MODULE
462:
463: $subject = preg_replace('`\[[^\]]*\]`', '', $header->subject);
464: if (is_array($header->from)) {
*****
Comment #5
Anonymous (not verified) commentedExcellent, I'll try out those changes. Thanks.
Comment #6
mariano.barcia commentedDid you get a chance to test this? Thanks.
Comment #7
tnfno commentedThis fix works for the subject. I also have a problem that the email body is broken up at the first special character (like Norwegian æøå ÆØÅ).
Comment #8
tnfno commentedTo answer my own question above: I fixed this by simply replacing everyting in function uc_ticket_get_body() with :
Probably not 100% correct, but it works for my Norwegian characters...
You also need to apply the other patch above to get UTF8 characters in the title.