Summary | Subject charset problem |
Queue | IMP |
Queue Version | 4.3.7 |
Type | Bug |
State | Not A Bug |
Priority | 2. Medium |
Owners | |
Requester | george (at) polarismail (dot) com |
Created | 05/12/2010 (5546 days ago) |
Due | |
Updated | 05/15/2010 (5543 days ago) |
Assigned | |
Resolved | 05/12/2010 (5546 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
messages were now showing fine while others still had question marks.
I started looking and finally traced it down to: imp/lib/IMAP/MessageCache.php
where the function retrieve that gets the subject ( and other header
pieces ) says... :
// There should not be any 8bit characters here. If there
// is, we either need to convert from the default charset
// or replace with question marks.
The line that verifies if I have a default charset is this:
if (!empty($GLOBALS['mime_headers']['default_charset'])) {
but my default_charset was empty even though it was setup in
imp/config/prefs.php - not sure why. This is a stock installation of
the latest Horde Webmail Groupware edition.
I simply added above that line, the following:
$GLOBALS['mime_headers']['default_charset']="US-ASCII";
and now finally all the subjects are showing fine.
The two issues were:
#1. UTF8 encoding in the subject line#2. missing default charset in IMPNLS::getCharset() 'bug' I noticed earlier. Since the subject is
already UTF8 there's no need to have that function return ISO-8859-1
The modified line in mailbox.php simply has to look like:
$msg['subject'] = utf8_encode($imp_ui->getSubject($ob->subject));
please ask on the mailing list.
I just fixed the issue by adding the following in mailbox.php at line 737:
$msg['subject']=utf8_encode($msg['subject']); right after
$msg['subject'] = $imp_ui->getSubject($ob->subject);
the code now looks like:
if (!empty($ob->subject)) {
$msg['subject'] = $imp_ui->getSubject($ob->subject);
$msg['subject']=utf8_encode($msg['subject']);
}
this effectively solves the problem and displays the characters
properly. Can you confirm if this is just a bug on our systems ( and
therefore we should make a note of it and update IMP ourselves ) or if
it's a general issue with IMP that will be fixed in future releases ?
We also had a very hard time with subjects encoded with ISO-8859. I
submitted more info to the mailing list but basically the solution was
to have NLS::getCharset return ISO-8859-1 instead of UTF-8
please ask on the mailing list.
problem occurs.
with this extension:
IMAP c-Client Version 2006j
Is this a known bug in the IMAP c-Client extension ?
State ⇒ Not A Bug
your c-client library (imap extension of PHP) is returning incorrect
data.
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Subject charset problem
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
display at all or show an '?' instead of the character. This is only
true in the Folder display window - where I see all my messages along
with their subjects.
When I open the actual message, the subject shows fine with the proper
characters.
Examples of words include:
Tecnológica , displays as: Tecnol?gica
dólar , displays nothing at all. empty subject line
I checked the html source and there really is nothing where the
subject is supposed to be. However, when I open the message the
subject is properly there.
Thank you!