<?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>non-ASCII 7-bit message headers not RFC2047-encoded</title> 
  <pubDate>Fri, 10 Apr 2026 06:01:22 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/1621</link> 
  <atom:link rel="self" type="application/rss+xml" title="non-ASCII 7-bit message headers not RFC2047-encoded" href="https://bugs.horde.org/ticket/1621/rss" /> 
  <description>non-ASCII 7-bit message headers not RFC2047-encoded</description> 
 
   
   
  <item> 
   <title>When using a non-ASCII, 7bit &quot;sending charset&quot; (such as ISO-</title> 
   <description>When using a non-ASCII, 7bit &quot;sending charset&quot; (such as ISO-2022-JP) the message headers are not being properly encoded, per RFC2047.  The MIME::encode() function appears to be using only the &quot;is8bit&quot; check in deciding to encode the text, regardless of whether or not it&#039;s ASCII.



The result of this is that the resulting mail headers end up being displayed as &quot;raw&quot; ISO-2022-JP text, which is &quot;gibberish&quot; to the user.</description> 
   <pubDate>Fri, 25 Mar 2005 00:16:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6624</link> 
  </item> 
   
  <item> 
   <title>Does this patch fix the problem:

http://cvs.horde.org/diff.</title> 
   <description>Does this patch fix the problem:

http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.143&amp;r2=1.144&amp;ty=u</description> 
   <pubDate>Fri, 25 Mar 2005 00:42:00 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6625</link> 
  </item> 
   
  <item> 
   <title>I applied this patch (the revised version that Chuck committ</title> 
   <description>I applied this patch (the revised version that Chuck committed a few minutes ago), but it did not fix my problem.  Although ISO-2022-JP is a multibyte character set, it consists of only 7-bit bytes--so the String::regexMatch() call returns an empty array, the is8bit() check subsequenty returns FALSE, and the RFC2047 encoding is not performed.</description> 
   <pubDate>Fri, 25 Mar 2005 06:18:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6638</link> 
  </item> 
   
  <item> 
   <title>Here&#039;s a patch for framework/MIME/MIME.php that seems to hav</title> 
   <description>Here&#039;s a patch for framework/MIME/MIME.php that seems to have fixed the problem on my system.  I&#039;m not 100% sure that it doesn&#039;t introduce any side effects, but I tested it with several character sets, and it appears to do the &quot;right thing&quot;. </description> 
   <pubDate>Fri, 25 Mar 2005 19:27:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6644</link> 
  </item> 
   
  <item> 
   <title>A couple issues with your patch:

1) We shouldn&#039;t be dealing</title> 
   <description>A couple issues with your patch:

1) We shouldn&#039;t be dealing with mb_* functions in MIME - these should be exclusively in String:: or elsewhere..

2) Any multibyte check should be done in MIME::is8bit() instead of MIME::encode()

3) The code seems to indicate that any string that is autodetected as not &#039;ASCII&#039;  needs to be encoded.  However, what if the string is autodetected as &#039;UTF-8&#039;?  If the UTF-8 characters are all in the ASCII range, then no encoding is required.

4) Multibyte characters will *not* be returned as 7-bit ASCII text from the mb_ereg _*functions.  Since this function is multibyte aware, it will know to combine consecutive multibyte bytes together to form the character.  I think the issue is that we are only looking for the 8-bit  characters in the Regex.  We are not looking for 7-bit characters **or multibyte characters**.  Therefore, we should probably just change the regex to search for &quot;Not 7-bit ASCII characters&quot; instead of searching for &quot;8-bit characters&quot;.



Could you try changing the regex in MIME::is8bit() to &quot;[^\x00-\x7f]&quot; and see if that fixes things?</description> 
   <pubDate>Fri, 25 Mar 2005 20:26:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6645</link> 
  </item> 
   
  <item> 
   <title>Well, I tried the &#039;[^\x00-\x7f]&#039; regex pattern in is8bit(), </title> 
   <description>Well, I tried the &#039;[^\x00-\x7f]&#039; regex pattern in is8bit(), but no dice.  I may be speaking ignorantly (in fact, it&#039;s very likely) but, even though we are using a multibyte-aware regex function, this character set (ISO-2022-JP) *is still* a 7-bit character set.  How are we going to find byte values in the range [\x80-\xff] in a 7-bit-byte character set?



I&#039;m starting to think this is a lost cause...I placed some diagnostic output in the String::regexMatch function and see that, even though the $charset being passed in is &quot;ISO-2022-JP&quot;, the resultant mb_regex_encoding() is &quot;EUC-JP&quot;.



IMHO, the root of this problem is that the MIME::encode function claims to &quot;Encode a string containing non-ASCII characters according to RFC 2047&quot;, while it actually only encodes strings containing non-8bit characters.  Since  non-8bit does not always imply ASCII, we need to find a good test of &quot;ASCII-ness&quot;.  I can test for ISO-2022-JP using a regex like &#039;\x1b[\(\$]&#039;, but it would be nicer to have a more general test (if one exists) for non-ASCII 7-bit encodings.</description> 
   <pubDate>Sat, 26 Mar 2005 00:00:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6649</link> 
  </item> 
   
  <item> 
   <title>So my reply, which will attempt to battle yours for ignoranc</title> 
   <description>So my reply, which will attempt to battle yours for ignorance :)



I do understand that ISO-2022-JP is a 7-bit charset in that any individual byte is in the range 00-7f (hex).  However, obviously, the charset uses the presence of an escape character to indicate that consecutive bytes need to be combined to properly form the character.



Therefore, it is my understanding that the mb_ereg_*() functions _should_ somehow be able to return a multibyte character when the non-charset preg_*() functions will not.  Example:



String: ESCAPE_CHARACTER MB_CHAR_1 MB_CHAR_2



This string has three bytes.  All three bytes are in the range 00-7f.  Therefore, doing a preg_*() match will result in this string appearing to be 3 7bit characters - thus, is8bit() will return false.



However, to mb_ereg()  this string should be interpreted as a single character, two byte string. Therefore a search for 00-7f *should* fail since the character is actually something more like 2e3f (hex).  Even though the underlying string is entirely 7bit, mb_ereg() should be applying the regex to the &quot;actual&quot; representation of the string.



All of this goes to tell me that it is probably an error with the regex which is causing the multibyte character to not be recognized.  I would think a regex like &quot;/.{1}/&quot; would match &quot;ESCAPE_CHARACTER&quot; for preg and &quot;japanese character&quot; for ereg().  However, I haven&#039;t yet figured out a way to do this in a single regex.  Anyone with ereg() style regex experience that could chime in would be appreciated.</description> 
   <pubDate>Wed, 30 Mar 2005 18:53:27 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t6759</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.198&amp;r2=1.199&amp;ty=u</description> 
   <pubDate>Fri, 25 Jul 2008 21:32:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47792</link> 
  </item> 
   
  <item> 
   <title>Reviving from the dead... how does this patch look/work?</title> 
   <description>Reviving from the dead... how does this patch look/work?</description> 
   <pubDate>Fri, 25 Jul 2008 21:35:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47795</link> 
  </item> 
   
  <item> 
   <title>Wow...3 1/2 years is a long time. :)



I&#039;ve moved on to a d</title> 
   <description>Wow...3 1/2 years is a long time. :)



I&#039;ve moved on to a different role in our organization, and don&#039;t work with Horde/IMP any longer; also, I believe our existing Horde environment is horribly out-of-date...so I don&#039;t think we&#039;ll be able to test this patch.



Thanks anyways!</description> 
   <pubDate>Fri, 25 Jul 2008 22:05:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47799</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.200&amp;r2=1.201&amp;ty=u
http://cvs.horde.org/diff.php/framework/MIME/MIME/Message.php?r1=1.100&amp;r2=1.101&amp;ty=u</description> 
   <pubDate>Fri, 25 Jul 2008 22:28:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47800</link> 
  </item> 
   
  <item> 
   <title>This patch also:

http://lists.horde.org/archives/cvs/Week-o</title> 
   <description>This patch also:

http://lists.horde.org/archives/cvs/Week-of-Mon-20080721/081444.html</description> 
   <pubDate>Fri, 25 Jul 2008 22:30:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47801</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.139.4.40&amp;r2=1.139.4.41&amp;ty=u
http://cvs.horde.org/diff.php/framework/MIME/MIME/Message.php?r1=1.76.10.17&amp;r2=1.76.10.18&amp;ty=u</description> 
   <pubDate>Sat, 26 Jul 2008 23:40:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47813</link> 
  </item> 
   
  <item> 
   <title>My changes seem to work well so going to mark this as resolv</title> 
   <description>My changes seem to work well so going to mark this as resolved.</description> 
   <pubDate>Sat, 26 Jul 2008 23:43:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t47814</link> 
  </item> 
   
  <item> 
   <title>Last change of MIME.php has a side-effect in the case of $ch</title> 
   <description>Last change of MIME.php has a side-effect in the case of $charset is iso-2022-jp,

it encodes us-ascii string too. 

This is a sample (User-Agent is Internet Messaging Program (IMP) H3 (4.3)).

---

Content-Type: text/plain;

        charset=ISO-2022-JP;

        DelSp*=&quot;iso-2022-jp&#039;&#039;Yes&quot;;

        format*=&quot;iso-2022-jp&#039;&#039;flowed&quot;

User-Agent: =?iso-2022-jp?b?SW50ZXJuZXQg?=

        =?iso-2022-jp?b?TWVzc2FnaW5nIA==?= =?iso-2022-jp?b?UHJvZ3JhbSA=?=

        =?iso-2022-jp?b?KElNUCkg?= =?iso-2022-jp?b?SDMg?=

        =?iso-2022-jp?b?KDQuMyk=?=

---



Please check the contents of string like this;

   ((stristr(&#039;iso-2022-jp&#039;, $charset) &amp;&amp; strstr($string, &quot;\x1b\$B&quot;))

</description> 
   <pubDate>Tue, 30 Sep 2008 02:23:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t49297</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.207&amp;r2=1.208&amp;ty=u</description> 
   <pubDate>Mon, 06 Oct 2008 16:07:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t49396</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/MIME/MIME.php?r1=1.139.4.43&amp;r2=1.139.4.44&amp;ty=u</description> 
   <pubDate>Mon, 06 Oct 2008 16:08:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t49397</link> 
  </item> 
   
  <item> 
   <title>That&#039;s a weird check, and I have no idea what it is checking</title> 
   <description>That&#039;s a weird check, and I have no idea what it is checking for, but other software apps do the same thing so I will take it on faith that it is doing what it is supposed to.  Fixed in Horde 3.3.1 and HEAD.</description> 
   <pubDate>Mon, 06 Oct 2008 16:09:31 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/1621#t49398</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
