<?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>MIME encoding of multibyte JP characters</title> 
  <pubDate>Fri, 10 Apr 2026 09:21:05 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/5972</link> 
  <atom:link rel="self" type="application/rss+xml" title="MIME encoding of multibyte JP characters" href="https://bugs.horde.org/ticket/5972/rss" /> 
  <description>MIME encoding of multibyte JP characters</description> 
 
   
   
  <item> 
   <title>Jan Schneider asked me to submit this bug report.



Imp doe</title> 
   <description>Jan Schneider asked me to submit this bug report.



Imp does not always encode the Subject line correctly when a non-default encoding is selected. I was able to replicate the error by typing Japanese characters into both the Subject and the body and selecting ISO-2022-JP encoding. The body of the message was sent correctly, but the Subject was garbled like so:

=?UNKNOWN?Q?=1B$BF|K=5C8l=1B=28B?=

This is what should have been sent:

=?iso-2022-jp?b?GyRCRnxLXDhsGyhC?=



Mailing list threads on this issue begin with these messages:

http://marc.info/?l=imp&amp;m=119695412415121&amp;w=2

http://article.gmane.org/gmane.comp.horde.imp/24146

Note: Gmane seems to display the Japanese test characters correctly, Marc does not.</description> 
   <pubDate>Thu, 06 Dec 2007 17:06:40 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t39521</link> 
  </item> 
   
  <item> 
   <title>Please note that current MIME::encode() is not able to encod</title> 
   <description>Please note that current MIME::encode() is not able to encode iso-2022-jp string. Please fix this first.</description> 
   <pubDate>Thu, 13 Dec 2007 13:48:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t39764</link> 
  </item> 
   
  <item> 
   <title>This one is easy.  None of our MIME:: functions work with mu</title> 
   <description>This one is easy.  None of our MIME:: functions work with multibyte characters.  And it may be difficult to fix this in PHP since we need a multibyte character-aware regular expression engine, and mb_ereg() doesn&#039;t seem to accept ISO-2022-JP as a valid charset - I get &#039;Warning: mb_regex_encoding() [function.mb-regex-encoding]: Unknown encoding &quot;ISO-2022-JP&quot;&#039; errors.



It *is* possible to use mb_encode_mimeheader() to encode multibyte headers properly, but mb_encode_mimeheader() is much much too greedy to use on everyday, non multi-byte messages (it apparently will encoding everything, even if the string is ASCII).  So this is a viable solution only if we can restrict use of this function to multibyte charsets only.  is there an easy way to determine if a charset is multibyte or not (without maintaing a static list)?</description> 
   <pubDate>Fri, 14 Dec 2007 08:44:36 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t39890</link> 
  </item> 
   
  <item> 
   <title>&gt; multibyte charsets only.  is there an easy way to determin</title> 
   <description>&gt; multibyte charsets only.  is there an easy way to determine if a 

&gt; charset is multibyte or not (without maintaing a static list)?



No, that&#039;s why we *have* that list in nls.php already, but only for the charsets we use in the translations.</description> 
   <pubDate>Fri, 14 Dec 2007 11:13:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t39904</link> 
  </item> 
   
  <item> 
   <title>I&#039;ve search the net and get a solution.

This code works for</title> 
   <description>I&#039;ve search the net and get a solution.

This code works for me both php-4.4 and php5.1.

Line-folding OK too.



function mbencode ($text,$charset)

{

  $sav_enc = mb_internal_encoding();

  mb_internal_encoding($charset);

  $ret = mb_encode_mimeheader($text,$charset,&#039;B&#039;);

  mb_internal_encoding($sav_enc);

  return $ret;

}

</description> 
   <pubDate>Mon, 17 Dec 2007 14:31:28 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t39988</link> 
  </item> 
   
  <item> 
   <title>&gt; I&#039;ve search the net and get a solution.

&gt; This code works</title> 
   <description>&gt; I&#039;ve search the net and get a solution.

&gt; This code works for me both php-4.4 and php5.1.

&gt; Line-folding OK too.

&gt;

&gt; function mbencode ($text,$charset)

&gt; {

&gt;   $sav_enc = mb_internal_encoding();

&gt;   mb_internal_encoding($charset);

&gt;   $ret = mb_encode_mimeheader($text,$charset,&#039;B&#039;);

&gt;   mb_internal_encoding($sav_enc);

&gt;   return $ret;

&gt; }



Please read the previous comments.  I already said mb_encode_mimeheader() works when using multibyte charsets.  The problem is that mb_encode_mimeheader() doesn&#039;t properly work for non-multibyte charsets.</description> 
   <pubDate>Tue, 18 Dec 2007 04:37:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t40016</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; I&#039;ve search the net and get a solution.

&gt;&gt; This code wor</title> 
   <description>&gt;&gt; I&#039;ve search the net and get a solution.

&gt;&gt; This code works for me both php-4.4 and php5.1.

&gt;&gt; Line-folding OK too.

&gt;&gt;

&gt;&gt; function mbencode ($text,$charset)

&gt;&gt; {

&gt;&gt;   $sav_enc = mb_internal_encoding();

&gt;&gt;   mb_internal_encoding($charset);

&gt;&gt;   $ret = mb_encode_mimeheader($text,$charset,&#039;B&#039;);

&gt;&gt;   mb_internal_encoding($sav_enc);

&gt;&gt;   return $ret;

&gt;&gt; }

&gt;

&gt; Please read the previous comments.  I already said 

&gt; mb_encode_mimeheader() works when using multibyte charsets.  The 

&gt; problem is that mb_encode_mimeheader() doesn&#039;t properly work for 

&gt; non-multibyte charsets.



Sorry confusion. My point is that mb_encode_mimeheader() doesn&#039;t work well

without calling mb_internal_encoding().



Attached file is my japanese-aware patch for horde-3.1.5 and imp-4.1.5.</description> 
   <pubDate>Tue, 18 Dec 2007 06:16:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t40017</link> 
  </item> 
   
  <item> 
   <title>That patch uses mb_* functions directly without checking for</title> 
   <description>That patch uses mb_* functions directly without checking for their existence, which is not acceptable.</description> 
   <pubDate>Mon, 24 Dec 2007 21:10:18 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t40260</link> 
  </item> 
   
  <item> 
   <title>&gt; That patch uses mb_* functions directly without checking f</title> 
   <description>&gt; That patch uses mb_* functions directly without checking for their 

&gt; existence, which is not acceptable.

Horde-3.1.3 INSTALL document says;

 Prerequisites

    c. UTF-8 support ``--with-iconv --enable-mbstring=all --enable-mbregex`

</description> 
   <pubDate>Wed, 26 Dec 2007 05:04:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t40351</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; That patch uses mb_* functions directly without checking </title> 
   <description>&gt;&gt; That patch uses mb_* functions directly without checking for their

&gt;&gt; existence, which is not acceptable.

&gt; Horde-3.1.3 INSTALL document says;

&gt;  Prerequisites

&gt;     c. UTF-8 support ``--with-iconv --enable-mbstring=all --enable-mbregex`



...and the header for that sections says:



   The following PHP options are **RECOMMENDED** to enable advanced features in Horde:



So mb* functions are not required to exist to run Horde.</description> 
   <pubDate>Wed, 26 Dec 2007 06:40:51 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t40357</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt;&gt; That patch uses mb_* functions directly without checking</title> 
   <description>&gt;&gt;&gt; That patch uses mb_* functions directly without checking for their

&gt;&gt;&gt; existence, which is not acceptable.



You are right.

So, I update my patch.</description> 
   <pubDate>Fri, 28 Dec 2007 02:06:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t40463</link> 
  </item> 
   
  <item> 
   <title>This looks very hackish to me. But I give Michael the final </title> 
   <description>This looks very hackish to me. But I give Michael the final call.</description> 
   <pubDate>Wed, 16 Jan 2008 22:46:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t41213</link> 
  </item> 
   
  <item> 
   <title>&gt; This looks very hackish to me. But I give Michael the fina</title> 
   <description>&gt; This looks very hackish to me. But I give Michael the final call.



This patch is not correct.  It breaks some things and doesn&#039;t fully fix the problem.  This issue is very complicated and is not something that can be adequately fixed for Horde 3.2.</description> 
   <pubDate>Thu, 17 Jan 2008 07:30:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t41263</link> 
  </item> 
   
  <item> 
   <title>Duplicate of Ticket #1621.</title> 
   <description>Duplicate of Ticket #1621.</description> 
   <pubDate>Fri, 25 Jul 2008 21:34:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/5972#t47794</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
