<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Subject charset problem</title> 
  <pubDate>Fri, 10 Apr 2026 17:02:28 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/9020</link> 
  <atom:link rel="self" type="application/rss+xml" title="Subject charset problem" href="https://bugs.horde.org/ticket/9020/rss" /> 
  <description>Subject charset problem</description> 
 
   
   
  <item> 
   <title>Subjects for messages containing foreign characters are eith</title> 
   <description>Subjects for messages containing foreign characters are either not display at all or show an &#039;?&#039; 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!

</description> 
   <pubDate>Wed, 12 May 2010 16:01:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58790</link> 
  </item> 
   
  <item> 
   <title>If it works in the message view, but not in the mailbox view</title> 
   <description>If it works in the message view, but not in the mailbox view, then your c-client library (imap extension of PHP) is returning incorrect data.</description> 
   <pubDate>Wed, 12 May 2010 16:54:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58794</link> 
  </item> 
   
  <item> 
   <title>We are running the following: php-5.3.2

with this extensi</title> 
   <description>We are running the following: php-5.3.2

with this extension:

IMAP c-Client Version	2006j

Is this a known bug in the IMAP c-Client extension ?
</description> 
   <pubDate>Thu, 13 May 2010 04:26:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58797</link> 
  </item> 
   
  <item> 
   <title>I just updated to version 2007e of the c-client library and </title> 
   <description>I just updated to version 2007e of the c-client library and the same problem occurs.</description> 
   <pubDate>Thu, 13 May 2010 04:57:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58800</link> 
  </item> 
   
  <item> 
   <title>It could also be the imap server&#039;s fault. If you need more s</title> 
   <description>It could also be the imap server&#039;s fault. If you need more support, please ask on the mailing list.</description> 
   <pubDate>Thu, 13 May 2010 15:23:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58812</link> 
  </item> 
   
  <item> 
   <title>&gt; It could also be the imap server&#039;s fault. If you need more</title> 
   <description>&gt; It could also be the imap server&#039;s fault. If you need more support, 
&gt; please ask on the mailing list.

Hi Jan,

I just fixed the issue by adding the following in mailbox.php at line 737:
$msg[&#039;subject&#039;]=utf8_encode($msg[&#039;subject&#039;]); right after

$msg[&#039;subject&#039;] = $imp_ui-&gt;getSubject($ob-&gt;subject);


the code now looks like:
if (!empty($ob-&gt;subject)) {
        $msg[&#039;subject&#039;] = $imp_ui-&gt;getSubject($ob-&gt;subject);
        $msg[&#039;subject&#039;]=utf8_encode($msg[&#039;subject&#039;]);
    }

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&#039;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
</description> 
   <pubDate>Sat, 15 May 2010 15:56:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58836</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; It could also be the imap server&#039;s fault. If you need mor</title> 
   <description>&gt;&gt; It could also be the imap server&#039;s fault. If you need more support,
&gt;&gt; please ask on the mailing list.
&gt;
&gt; Hi Jan,
&gt;
&gt; I just fixed the issue by adding the following in mailbox.php at line 737:
&gt; $msg[&#039;subject&#039;]=utf8_encode($msg[&#039;subject&#039;]); right after
&gt;
&gt; $msg[&#039;subject&#039;] = $imp_ui-&gt;getSubject($ob-&gt;subject);
&gt;
&gt;
&gt; the code now looks like:
&gt; if (!empty($ob-&gt;subject)) {
&gt;         $msg[&#039;subject&#039;] = $imp_ui-&gt;getSubject($ob-&gt;subject);
&gt;         $msg[&#039;subject&#039;]=utf8_encode($msg[&#039;subject&#039;]);
&gt;     }
&gt;
&gt; this effectively solves the problem and displays the characters 
&gt; properly. Can you confirm if this is just a bug on our systems ( and 
&gt; therefore we should make a note of it and update IMP ourselves ) or 
&gt; if it&#039;s a general issue with IMP that will be fixed in future 
&gt; releases ?
&gt;
&gt; We also had a very hard time with subjects encoded with ISO-8859. I 
&gt; submitted more info to the mailing list but basically the solution 
&gt; was to have NLS::getCharset return ISO-8859-1 instead of UTF-8
&gt;

I just realized that encoding the subject to UTF8 also fixes the NLS::getCharset() &#039;bug&#039; I noticed earlier. Since the subject is already UTF8 there&#039;s no need to have that function return ISO-8859-1

The modified line in mailbox.php simply has to look like:

$msg[&#039;subject&#039;] = utf8_encode($imp_ui-&gt;getSubject($ob-&gt;subject));


</description> 
   <pubDate>Sat, 15 May 2010 16:02:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58837</link> 
  </item> 
   
  <item> 
   <title>As it turns out, the issue was only half fixed - not sure wh</title> 
   <description>As it turns out, the issue was only half fixed - not sure why. Some 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[&#039;mime_headers&#039;][&#039;default_charset&#039;])) {

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[&#039;mime_headers&#039;][&#039;default_charset&#039;]=&quot;US-ASCII&quot;;

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 IMP

</description> 
   <pubDate>Sat, 15 May 2010 17:24:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9020#t58838</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
