<?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>charset pb replying to message</title> 
  <pubDate>Fri, 10 Apr 2026 02:21:31 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/9567</link> 
  <atom:link rel="self" type="application/rss+xml" title="charset pb replying to message" href="https://bugs.horde.org/ticket/9567/rss" /> 
  <description>charset pb replying to message</description> 
 
   
   
  <item> 
   <title>using dynamic view
compose_html=1
reply_format=1

attach</title> 
   <description>using dynamic view
compose_html=1
reply_format=1

attached is the message from ticket #9189 and #9190.

replying to this message gives :
&quot;prÃ©parer Ã  vendre dâaoÃ»tÂ ; &quot;
expected : 
&quot;préparer à vendre d&#039;août ;&quot;

Funny thing is (this probably is related to ticket #9549) :
using dynamic view,
- select message and reply
- click on &quot;HTML composition&quot; (do not click or modify the body of the message)

output : 
&lt;p&gt;&lt;a href=&quot;mailto:ronan@maison.com&quot;&gt;ronan@maison.com&lt;/a&gt; a écrit :&lt;/p&gt;&lt;blockquote type=&quot;cite&quot; style=&quot;border-left:2px solid blue;margin-left:8px;padding-left:8px;&quot;&gt;&amp;gt; Bonjour,&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;gt;  &lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;gt; préparer à vendre d?août ;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;

the output is html source, but the text (accents) looks ok.

</description> 
   <pubDate>Wed, 09 Feb 2011 14:47:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61738</link> 
  </item> 
   
  <item> 
   <title>Duplicate of Bug #9549.</title> 
   <description>Duplicate of Bug #9549.</description> 
   <pubDate>Wed, 09 Feb 2011 19:12:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61746</link> 
  </item> 
   
  <item> 
   <title>&gt; Duplicate of Bug #9549.

I agree that my first comment c</title> 
   <description>&gt; Duplicate of Bug #9549.

I agree that my first comment can be a bit confusing, and that the part with &quot;HTML composition&quot; is can be a duplicate of Bug #9549.

But the first part is not a duplicate of Bug #9549. When I reply to the attached message, accents are showing OK.
</description> 
   <pubDate>Thu, 10 Feb 2011 08:08:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61762</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Duplicate of Bug #9549.
&gt;
&gt; I agree that my first comme</title> 
   <description>&gt;&gt; Duplicate of Bug #9549.
&gt;
&gt; I agree that my first comment can be a bit confusing, and that the 
&gt; part with &quot;HTML composition&quot; is can be a duplicate of Bug #9549.
&gt;
&gt; But the first part is not a duplicate of Bug #9549. When I reply to 
&gt; the attached message, accents are showing OK.

So there is no longer an issue, correct?  I can&#039;t reproduce.</description> 
   <pubDate>Fri, 11 Feb 2011 09:12:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61777</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; But the first part is not a duplicate of Bug #9549. When </title> 
   <description>&gt;&gt; But the first part is not a duplicate of Bug #9549. When I reply to
&gt;&gt; the attached message, accents are showing OK.
&gt;
&gt; So there is no longer an issue, correct?  I can&#039;t reproduce.

Arrgh, really bad week.  I meant  &quot;accents are not showing OK&quot;.

I can&#039;t debug today. I updated from git this morning and I can&#039;t use dynamic imp now (see below). I have either missed something or there&#039;s something wrong in git repo. I&#039;ll wait monday...


A fatal error has occurred
&quot;Array&quot; is not configured in the Horde Registry.

1. require() /var/www/html/hordetest/imp/index.php:19
2. IMP_Dimp::header() /var/www/html/hordetest/imp/index-dimp.php:38
3. include() /var/www/html/hordetest/imp/lib/Dimp.php:78
4. include() /var/www/html/hordetest/imp/templates/common-header.inc:9
5. Horde_Registry-&gt;getInitialPage() /var/www/html/hordetest/imp/templates/dimp/javascript_defs.php:22

</description> 
   <pubDate>Fri, 11 Feb 2011 14:03:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61779</link> 
  </item> 
   
  <item> 
   <title>&gt; A fatal error has occurred
&gt; &quot;Array&quot; is not configured in</title> 
   <description>&gt; A fatal error has occurred
&gt; &quot;Array&quot; is not configured in the Horde Registry.

You did not update imp/config/portal.php for changes made last night.</description> 
   <pubDate>Fri, 11 Feb 2011 17:32:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61782</link> 
  </item> 
   
  <item> 
   <title>Restarting from scratch to explain the issue I&#039;m having when</title> 
   <description>Restarting from scratch to explain the issue I&#039;m having when replying to messages.

using the message attached to this ticket, traditional view mode,

- $_prefs[&#039;compose_html&#039;][&#039;value&#039;] = 0;
- $_prefs[&#039;reply_format&#039;][&#039;value&#039;] = 0;
=&gt; reply Ok

- $_prefs[&#039;compose_html&#039;][&#039;value&#039;] = 1;
- $_prefs[&#039;reply_format&#039;][&#039;value&#039;] = 1;
=&gt; reply *NOK*

see attached screenshot, accents look like rubbish. 

</description> 
   <pubDate>Mon, 28 Feb 2011 08:43:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t61958</link> 
  </item> 
   
  <item> 
   <title>Still working perfectly here.</title> 
   <description>Still working perfectly here.</description> 
   <pubDate>Thu, 03 Mar 2011 23:00:04 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62015</link> 
  </item> 
   
  <item> 
   <title>&gt; Still working perfectly here.

body (variable $msg) look</title> 
   <description>&gt; Still working perfectly here.

body (variable $msg) looks fine up to line 2504 in imp/lib/Compose.php

        if ($mode == &#039;html&#039;) {
            $msg = $GLOBALS[&#039;injector&#039;]-&gt;getInstance(&#039;Horde_Core_Factory_TextFilter&#039;)-&gt;filter($msg, array(&#039;Cleanhtml&#039;, &#039;Xss&#039;), array(array(&#039;body_only&#039; =&gt; true), array(&#039;strip_styles&#039; =&gt; true, &#039;strip_style_attributes&#039; =&gt; false)));
        } elseif ($type == &#039;text/html&#039;) {
            $msg = $GLOBALS[&#039;injector&#039;]-&gt;getInstance(&#039;Horde_Core_Factory_TextFilter&#039;)-&gt;filter($msg, &#039;Html2text&#039;);
            $type = &#039;text/plain&#039;;
        }

but after line 2511, msg looks wrong (accent are screwed).

If I change array(&#039;Cleanhtml&#039;, &#039;Xss&#039;) to array(), accents look OK (but the reply message is a bit screwed :-)).

</description> 
   <pubDate>Fri, 04 Mar 2011 16:09:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62034</link> 
  </item> 
   
  <item> 
   <title>I got further.

problem is coming from Domhtml.php. DOMDoc</title> 
   <description>I got further.

problem is coming from Domhtml.php. DOMDocument thinks that $text is iso-8859-1, but it is UTF-8 as it has been converted earlier on.

The text message gets screwed after the following call (line 83) :
                $doc-&gt;loadHTML(Horde_String::convertCharset($text, $charset, $doc-&gt;encoding));

$charset = utf-8
$doc-&gt;encoding = iso-8859-1

I don&#039;t know what to do from there. Anyway I can help ?

I use:
Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.2.13) Gecko/20110103 Fedora/3.6.13-1.fc14 Firefox/3.6.13
php-5.3.5-1.el5.remi.1

</description> 
   <pubDate>Fri, 04 Mar 2011 16:37:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62035</link> 
  </item> 
   
  <item> 
   <title>&gt; I got further.
&gt;
&gt; problem is coming from Domhtml.php. D</title> 
   <description>&gt; I got further.
&gt;
&gt; problem is coming from Domhtml.php. DOMDocument thinks that $text is 
&gt; iso-8859-1, but it is UTF-8 as it has been converted earlier on.
&gt;
&gt; The text message gets screwed after the following call (line 83) :
&gt;                 $doc-&gt;loadHTML(Horde_String::convertCharset($text, 
&gt; $charset, $doc-&gt;encoding));
&gt;
&gt; $charset = utf-8
&gt; $doc-&gt;encoding = iso-8859-1

So what you are saying is that BEFORE line 83, $charset is utf-8 and $doc-&gt;encoding is iso-8859-1?  If that is the case, I don&#039;t see why this isn&#039;t working... we are converting $text to ISO-8859-1 (from UTF-8) and then sending to loadHTML.  So things should be fine.

Maybe check what the value of $doc-&gt;encoding is AFTER line 83?  Or try creating a new DOMDocument object - e.g.:

                /* If libxml can&#039;t auto-detect encoding, convert to what it
                 * *thinks* the encoding should be. */
                $doc = new DOMDocument();
                $doc-&gt;loadHTML(Horde_String::convertCharset($text, $charset, $doc-&gt;encoding));</description> 
   <pubDate>Fri, 04 Mar 2011 17:59:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62042</link> 
  </item> 
   
  <item> 
   <title>&gt; So what you are saying is that BEFORE line 83, $charset is</title> 
   <description>&gt; So what you are saying is that BEFORE line 83, $charset is utf-8 and 
&gt; $doc-&gt;encoding is iso-8859-1?  If that is the case, I don&#039;t see why 
&gt; this isn&#039;t working... we are converting $text to ISO-8859-1 (from 
&gt; UTF-8) and then sending to loadHTML.  So things should be fine.

I got mislead with editors charset. Depending on which one I was using (vi, nedit) I wasn&#039;t getting (seeing)  the same output, and I just realised that now.

So, this got me up to framework/Text_Filter/lib/Horde/Text/Filter/Xss.php

I&#039;ve attached the log patch and horde log file. The log file is trace of replying to the message.

It looks like dom-&gt;saveXML returns UTF-8 characters.

If I change the last &#039;return&#039; of function postProcess($text) like this
-        return Horde_String::convertCharset($text, $dom-&gt;encoding, $this-&gt;_params[&#039;charset&#039;]);
+        return $text;

Then accents look Ok!
</description> 
   <pubDate>Mon, 07 Mar 2011 09:22:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62085</link> 
  </item> 
   
  <item> 
   <title>I&#039;ve attached the wrong file in the last comment.</title> 
   <description>I&#039;ve attached the wrong file in the last comment.</description> 
   <pubDate>Mon, 07 Mar 2011 09:37:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62086</link> 
  </item> 
   
  <item> 
   <title>with the patch attached (and using the message originally at</title> 
   <description>with the patch attached (and using the message originally attached to this ticket), here is the output of charset detection :

2011-03-09T09:33:34+01:00 INFO: HORDE [imp] 777777777777777777ASCII [pid 15410 on line 130 of &quot;/var/www/html/hordetest/libs/Horde/Text/Filter/Xss.php&quot;]
2011-03-09T09:33:34+01:00 INFO: HORDE [imp] 777777777777777777UTF-8 [pid 15410 on line 130 of &quot;/var/www/html/hordetest/libs/Horde/Text/Filter/Xss.php&quot;]
2011-03-09T09:33:34+01:00 INFO: HORDE [imp] 777777777777777777ASCII [pid 15410 on line 130 of &quot;/var/www/html/hordetest/libs/Horde/Text/Filter/Xss.php&quot;]
2011-03-09T09:33:34+01:00 INFO: HORDE [imp] 777777777777777777UTF-8 [pid 15410 on line 133 of &quot;/var/www/html/hordetest/libs/Horde/Text/Filter/Xss.php&quot;]
2011-03-09T09:33:34+01:00 INFO: HORDE [imp] 777777777777777777iso-8859-1 [pid 15410 on line 134 of &quot;/var/www/html/hordetest/libs/Horde/Text/Filter/Xss.php&quot;]


So, this confirm that dom-&gt;saveXML returns UTF-8 characters, but $doc-&gt;encoding is iso-8859-1.

I&#039;m having this issue not only with the attached message, but pretty much with all messages in my inbox (as a matter of fact all messages containing accents).

Just in case this was related to libxml, I&#039;ve update the lib to libxml2-2.7.8

</description> 
   <pubDate>Wed, 09 Mar 2011 08:46:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62138</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Add test for</title> 
   <description>Changes have been made in Git for this ticket:

Add test for Bug #9567

 1 files changed, 0 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/9bc38e1452ccb11d2c709175b65d705243df1ad0</description> 
   <pubDate>Thu, 10 Mar 2011 20:24:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62214</link> 
  </item> 
   
  <item> 
   <title>I have added a test case in Text_Filter that passes for me. </title> 
   <description>I have added a test case in Text_Filter that passes for me.  See if it passes for you.

Easiest way to run is to go to horde/framework/Text_Filter/test/Horde/Text/Filter and run &#039;php AllTests.php&#039;</description> 
   <pubDate>Thu, 10 Mar 2011 20:26:10 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62215</link> 
  </item> 
   
  <item> 
   <title>&gt; I have added a test case in Text_Filter that passes for me</title> 
   <description>&gt; I have added a test case in Text_Filter that passes for me.  See if 
&gt; it passes for you.

after installing PHPUnit (thanks to remi&#039;s repo) I get 2 failures running the test, but not related to this bug I guess.

see attatched log file.

I can provide you another message as an example if you want, but I can&#039;t attach it to this ticket as it is a non public message. I tried to remove private information, but no matter what editor I was using, I always ended up altering the charset of the message when saving.

</description> 
   <pubDate>Sat, 12 Mar 2011 16:24:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62239</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; I have added a test case in Text_Filter that passes for m</title> 
   <description>&gt;&gt; I have added a test case in Text_Filter that passes for me.  See if
&gt;&gt; it passes for you.
&gt;
&gt; after installing PHPUnit (thanks to remi&#039;s repo) I get 2 failures 
&gt; running the test, but not related to this bug I guess.

Yes - those are not related to this bug.

A user had submitted this patch awhile back.  Maybe this fixes things for you?</description> 
   <pubDate>Tue, 15 Mar 2011 03:06:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62310</link> 
  </item> 
   
  <item> 
   <title>Patch originally appeared in this message:

http://lists.h</title> 
   <description>Patch originally appeared in this message:

http://lists.horde.org/archives/dev/Week-of-Mon-20101115/025488.html</description> 
   <pubDate>Tue, 15 Mar 2011 03:06:51 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62311</link> 
  </item> 
   
  <item> 
   <title>&gt; A user had submitted this patch awhile back.  Maybe this f</title> 
   <description>&gt; A user had submitted this patch awhile back.  Maybe this fixes things 
&gt; for you?

Nope, it does fix anything, although I use the same OS Centos 5.4, but probably not the same libxml/php version

Googling a bit, I ran into this article http://devzone.zend.com/article/8855, 5. Save/dumping operations and encoding :

&quot;Node or XML subtree dumping using the DOMDocument::saveXML($node) method is always performed in UTF-8.&quot;

This is the issue I&#039;m having, $dom-&gt;encoding = iso-8859-1 and $dom-&gt;dom-&gt;saveXML($child) returns utf-8.

The following patch works for me for all messages read, reply, forward... (for whatever I&#039;ve tested so far) :
--- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
+++ Xss.php	2011-03-15 10:41:24.000000000 +0100
@@ -130,7 +130,7 @@
             }
         }
 
-        return Horde_String::convertCharset($text, $dom-&gt;encoding, $this-&gt;_params[&#039;charset&#039;]);
+        return $text;
     }
 
     /**



</description> 
   <pubDate>Tue, 15 Mar 2011 09:54:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62318</link> 
  </item> 
   
  <item> 
   <title>&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt; +++</title> 
   <description>&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt; +++ Xss.php	2011-03-15 10:41:24.000000000 +0100
&gt; -        return Horde_String::convertCharset($text, $dom-&gt;encoding,  $this-&gt;_params[&#039;charset&#039;]);
&gt; +        return $text;

with this patch, testBug9567 fails.
I&#039;ve attached the output.</description> 
   <pubDate>Tue, 15 Mar 2011 10:15:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62319</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt;&gt; +</title> 
   <description>&gt;&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt;&gt; +++ Xss.php	2011-03-15 10:41:24.000000000 +0100
&gt;&gt; -        return Horde_String::convertCharset($text, $dom-&gt;encoding,  
&gt;&gt; $this-&gt;_params[&#039;charset&#039;]);
&gt;&gt; +        return $text;
&gt;
&gt; with this patch, testBug9567 fails.
&gt; I&#039;ve attached the output.

OK - I am *totally confused*.  The test runs successfully.  Why should we be patching?  Of course the test is going to fail - you are altering the output for a successful test.</description> 
   <pubDate>Tue, 15 Mar 2011 16:56:30 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62333</link> 
  </item> 
   
  <item> 
   <title>&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt; +++</title> 
   <description>&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt; +++ Xss.php	2011-03-15 10:41:24.000000000 +0100
&gt; @@ -130,7 +130,7 @@
&gt;              }
&gt;          }
&gt;
&gt; -        return Horde_String::convertCharset($text, $dom-&gt;encoding, 
&gt; $this-&gt;_params[&#039;charset&#039;]);
&gt; +        return $text;
&gt;      }

This isn&#039;t correct.  Xss filter needs to return text in whatever charset it was provided in, which is why the convertCharset() call is necessary.  The question is why $dom-&gt;encoding is &#039;ISO-8859-1&#039; for you and &#039;UTF-8&#039; for *everybody* else.</description> 
   <pubDate>Tue, 15 Mar 2011 17:04:01 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62334</link> 
  </item> 
   
  <item> 
   <title>&gt; http://devzone.zend.com/article/8855

This may be useful</title> 
   <description>&gt; http://devzone.zend.com/article/8855

This may be useful, specifically Section 4 about loading/encoding.  This is the starting point in trying to figure this out.</description> 
   <pubDate>Tue, 15 Mar 2011 17:12:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62335</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt;&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt;&gt;&gt;</title> 
   <description>&gt;&gt;&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt;&gt;&gt; +++ Xss.php	2011-03-15 10:41:24.000000000 +0100
&gt;&gt;&gt; -        return Horde_String::convertCharset($text, $dom-&gt;encoding,
&gt;&gt;&gt; $this-&gt;_params[&#039;charset&#039;]);
&gt;&gt;&gt; +        return $text;
&gt;&gt;
&gt;&gt; with this patch, testBug9567 fails.
&gt;&gt; I&#039;ve attached the output.
&gt;
&gt; OK - I am *totally confused*.  The test runs successfully.  Why 
&gt; should we be patching?  Of course the test is going to fail - you are 
&gt; altering the output for a successful test.

I&#039;m lost as well, and desperately trying to find a way out of this. Forget about this *patch*
</description> 
   <pubDate>Tue, 15 Mar 2011 22:06:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62339</link> 
  </item> 
   
  <item> 
   <title>&gt; This isn&#039;t correct.  Xss filter needs to return text in wh</title> 
   <description>&gt; This isn&#039;t correct.  Xss filter needs to return text in whatever 
&gt; charset it was provided in, which is why the convertCharset() call is 
&gt; necessary.  The question is why $dom-&gt;encoding is &#039;ISO-8859-1&#039; for 
&gt; you and &#039;UTF-8&#039; for *everybody* else.

Hmm wait, weird, the message attached to this ticket looks wrong. re-attaching the message. 

To the question as why $dom-&gt;encoding is &#039;ISO-8859-1&#039;, the answer is in the message :
&lt;!--a75c305b1c0a6022--&gt;&lt;meta http-equiv=3DContent-Type content=3D&quot;text/html; charset=3Diso-8859-1&quot;=

If I change &#039;charset=3Diso-8859-1&quot;=&#039; to &#039;charset=3Diso-8859-15&quot;=&#039;, then $dom-&gt;encoding = ISO-8859-15

If I remove the meta tag from the message, everything works fine.

I&#039;ve checked other messages I&#039;m having issue with, and they all have the same charset meta tag 

So this behaviour is expected according to http://devzone.zend.com/article/8855, Section 4.


I don&#039;t understand why this doesn&#039;t work here and works for you. What version of libxml2 and php are you using just in case this is related to the version I&#039;m using. As I&#039;m using the latest (or close enough), I&#039;ll try to downgrade to whatever version you are using.


</description> 
   <pubDate>Tue, 15 Mar 2011 22:12:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62340</link> 
  </item> 
   
  <item> 
   <title>&gt; To the question as why $dom-&gt;encoding is &#039;ISO-8859-1&#039;, the</title> 
   <description>&gt; To the question as why $dom-&gt;encoding is &#039;ISO-8859-1&#039;, the answer is 
&gt; in the message :
&gt; &lt;!--a75c305b1c0a6022--&gt;&lt;meta http-equiv=3DContent-Type content=3D&quot;text/html; charset=3Diso-8859-1&quot;=

Maybe one problem is that this message is NOT iso-8859-1; it is windows-1252.</description> 
   <pubDate>Tue, 15 Mar 2011 22:41:22 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62342</link> 
  </item> 
   
  <item> 
   <title>&gt; I don&#039;t understand why this doesn&#039;t work here and works fo</title> 
   <description>&gt; I don&#039;t understand why this doesn&#039;t work here and works for you. What 
&gt; version of libxml2 and php are you using just in case this is related 
&gt; to the version I&#039;m using. As I&#039;m using the latest (or close enough), 
&gt; I&#039;ll try to downgrade to whatever version you are using.

PHP 5.3.4 (cli) (built: Feb 12 2011 00:26:56)
libxml2 Version =&gt; 2.7.8</description> 
   <pubDate>Tue, 15 Mar 2011 23:01:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62343</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; To the question as why $dom-&gt;encoding is &#039;ISO-8859-1&#039;, th</title> 
   <description>&gt;&gt; To the question as why $dom-&gt;encoding is &#039;ISO-8859-1&#039;, the answer is
&gt;&gt; in the message :
&gt;&gt; &lt;!--a75c305b1c0a6022--&gt;&lt;meta http-equiv=3DContent-Type content=3D&quot;text/html; charset=3Diso-8859-1&quot;=
&gt;
&gt; Maybe one problem is that this message is NOT iso-8859-1; it is windows-1252.

If I change &lt;!--a75c305b1c0a6022--&gt;&lt;meta http-equiv=3DContent-Type content=3D&quot;text/html; charset=3Diso-8859-1&quot;= to &lt;!--a75c305b1c0a6022--&gt;&lt;meta http-equiv=3DContent-Type content=3D&quot;text/html; charset=3Dwindows-1252&quot;=
I get the $dom-&gt;encoding = windows-1252 which is I my case expected and the same result as before : rubbish.

</description> 
   <pubDate>Wed, 16 Mar 2011 07:50:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62350</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; I don&#039;t understand why this doesn&#039;t work here and works f</title> 
   <description>&gt;&gt; I don&#039;t understand why this doesn&#039;t work here and works for you. What
&gt;&gt; version of libxml2 and php are you using just in case this is related
&gt;&gt; to the version I&#039;m using. As I&#039;m using the latest (or close enough),
&gt;&gt; I&#039;ll try to downgrade to whatever version you are using.
&gt;
&gt; PHP 5.3.4 (cli) (built: Feb 12 2011 00:26:56)
&gt; libxml2 Version =&gt; 2.7.8

I recompiled both libxml2 and php, still having the same issue :-(


</description> 
   <pubDate>Wed, 16 Mar 2011 15:50:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62357</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt;&gt; +</title> 
   <description>&gt;&gt; --- Xss.php.org	2011-03-15 10:41:22.000000000 +0100
&gt;&gt; +++ Xss.php	2011-03-15 10:41:24.000000000 +0100
&gt;&gt; -        return Horde_String::convertCharset($text, $dom-&gt;encoding,
&gt;&gt; $this-&gt;_params[&#039;charset&#039;]);
&gt;&gt; +        return $text;
&gt; This isn&#039;t correct.  Xss filter needs to return text in whatever 
&gt; charset it was provided in, which is why the convertCharset() call is 
&gt; necessary.  The question is why $dom-&gt;encoding is &#039;ISO-8859-1&#039; for 
&gt; you and &#039;UTF-8&#039; for *everybody* else.

If we assume that information from this link http://devzone.zend.com/article/8855 are right, specifically section 5 : &quot;DOMDocument::saveXML($node) method is always performed in UTF-8&quot;

Then, no matter what $doc-&gt;encoding is set to, the following code will *always* return a UTF-8 encoded string :
 if ($body &amp;&amp; $body-&gt;hasChildNodes()) {
	 foreach ($body-&gt;childNodes as $child) {
		 $text .= $dom-&gt;dom-&gt;saveXML($child);
	 }
 }

So, I think that Horde_Text_Filter_Xss::postProcess should be patch like this :

- return Horde_String::convertCharset($text, $dom-&gt;encoding, $this-&gt;_params[&#039;charset&#039;]);
+ return Horde_String::convertCharset($text, &#039;UTF-8&#039;, $this-&gt;_params[&#039;charset&#039;]);


Now, why $dom-&gt;encoding is different on my machine than yours, I don&#039;t have the answer (and I tried a lot of things). but according to http://devzone.zend.com/article/8855, Section 4, DOMDocument::loadHTML() should detect meta tag &#039;charset&#039;, and on my system, it does (I guess) and this should explain as why $dom-&gt;encoding=iso-8859-1 (or whatever charset the meta tag is set to, see other comments).


As I think that the above small patch is right, I don&#039;t mind if some of the other dev can try to reply to the message &#039;email_charset.eml&#039; to see if I&#039;m really alone on this one.

Thanks.

</description> 
   <pubDate>Wed, 16 Mar 2011 16:41:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62358</link> 
  </item> 
   
  <item> 
   <title>&gt; As I think that the above small patch is right, I don&#039;t mi</title> 
   <description>&gt; As I think that the above small patch is right, I don&#039;t mind if some 
&gt; of the other dev can try to reply to the message &#039;email_charset.eml&#039; 
&gt; to see if I&#039;m really alone on this one.

I didn&#039;t follow the complete ticket history, but I don&#039;t see anything wrong when replying to this message in traditional mode, using the HTML editor.</description> 
   <pubDate>Wed, 16 Mar 2011 16:53:29 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62361</link> 
  </item> 
   
  <item> 
   <title>This is driving mad.

For the last 20 minutes, I can&#039;t rep</title> 
   <description>This is driving mad.

For the last 20 minutes, I can&#039;t reproduce this issue any more. 
But I don&#039;t know why, I don&#039;t know what I did or changed :-(

Anyway, since I can&#039;t reproduce this issue any more, I guess there is no need to keep this ticket open. 

But I think the patch from comment #31 still applies.

Thanks for you patience.
</description> 
   <pubDate>Wed, 16 Mar 2011 17:28:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62363</link> 
  </item> 
   
  <item> 
   <title>I still can&#039;t reproduce the behaviour I was having using IMP</title> 
   <description>I still can&#039;t reproduce the behaviour I was having using IMP, but I found a way to reproduce using the test case in Text_Filter you originally created.

See attached file, I think that this is how the test case in Text_Filter should work.

The test passes OK with the patch from comment #31.

What do you think ?


</description> 
   <pubDate>Thu, 17 Mar 2011 08:29:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62373</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Add another </title> 
   <description>Changes have been made in Git for this ticket:

Add another test for Bug #9567

 1 files changed, 0 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/423b29e9ae9e6b4227f7d8870aa8a2b6d823f120</description> 
   <pubDate>Thu, 17 Mar 2011 17:08:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62388</link> 
  </item> 
   
  <item> 
   <title>&gt; Changes have been made in Git for this ticket:
&gt;
&gt; Add a</title> 
   <description>&gt; Changes have been made in Git for this ticket:
&gt;
&gt; Add another test for Bug #9567

typos : it is 
content=&quot;text/html; charset=iso-8859-1&quot; instead of 
content=&quot;text/html; charset=&quot;iso8859-1&quot;


</description> 
   <pubDate>Thu, 17 Mar 2011 17:19:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62389</link> 
  </item> 
   
  <item> 
   <title>&gt; See attached file, I think that this is how the test case </title> 
   <description>&gt; See attached file, I think that this is how the test case in 
&gt; Text_Filter should work.

Nope.  Works perfect for me.</description> 
   <pubDate>Thu, 17 Mar 2011 17:24:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62392</link> 
  </item> 
   
  <item> 
   <title>&gt; typos : it is
&gt; content=&quot;text/html; charset=iso-8859-1&quot; i</title> 
   <description>&gt; typos : it is
&gt; content=&quot;text/html; charset=iso-8859-1&quot; instead of
&gt; content=&quot;text/html; charset=&quot;iso8859-1&quot;

This shouldn&#039;t (and doesn&#039;t) make a difference.</description> 
   <pubDate>Thu, 17 Mar 2011 17:26:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62395</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Bug #9567: I</title> 
   <description>Changes have been made in Git for this ticket:

Bug #9567: Improve loading of HTML documents

 6 files changed, 123 insertions(+), 46 deletions(-)
http://git.horde.org/horde-git/-/commit/cf8cb46f13765b88342477735f7bbb473727fffd</description> 
   <pubDate>Thu, 17 Mar 2011 18:34:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62403</link> 
  </item> 
   
  <item> 
   <title>Rewrote HTML document loading to better match what the URL b</title> 
   <description>Rewrote HTML document loading to better match what the URL below describes.  See if this helps.</description> 
   <pubDate>Thu, 17 Mar 2011 18:35:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62404</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in Git for this ticket:

Bug #9567: X</title> 
   <description>Changes have been made in Git for this ticket:

Bug #9567: XML encoding tag may not appear at beginning of output

 1 files changed, 6 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/ba922deff269a9a6a35427610ddb6eb3adf9282f</description> 
   <pubDate>Thu, 17 Mar 2011 21:29:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62406</link> 
  </item> 
   
  <item> 
   <title>&gt; Rewrote HTML document loading to better match what the URL</title> 
   <description>&gt; Rewrote HTML document loading to better match what the URL below 
&gt; describes.  See if this helps.

Replying seems to be working just fine. I tried with a few messages and they all looked OK.

I ran the new test case, and it fails. See attached log file.


</description> 
   <pubDate>Fri, 18 Mar 2011 08:21:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62412</link> 
  </item> 
   
  <item> 
   <title>&gt; I ran the new test case, and it fails. See attached log fi</title> 
   <description>&gt; I ran the new test case, and it fails. See attached log file.

I add a problem pulling up to date code from git, and I didn&#039;t notice until now. 

The test passes OK.</description> 
   <pubDate>Fri, 18 Mar 2011 09:27:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62418</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; I ran the new test case, and it fails. See attached log f</title> 
   <description>&gt;&gt; I ran the new test case, and it fails. See attached log file.
&gt; I add a problem pulling up to date code from git, and I didn&#039;t notice 
&gt; until now.

I meant, I *had* a problem! Everything looks good now.</description> 
   <pubDate>Fri, 18 Mar 2011 09:30:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9567#t62420</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
