Incorrect char encoding with $wrapper

Dan Finkelstein <[email protected]> Fri, 22 Jul 2005 15:18:33 -0700
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
--=====================_24586609==.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable

Hi --

I am just trying to add some internalization support to my Maverick=20
application, which has been running flawlessly for years (!), and I ran=20
into a problem.  What seems to happen is that the page that is to be=20
inserted into $wrapper goes through some undesired transformation.  I have=
=20
configured Maverick to use UTF-8 via the defaultRequestCharset=20
parameter.  I also configured Velocity to use UTF-8 for reading templates=20
with input.encoding=3DUTF-8 and for writing output with=20
output.encoding=3DUTF-8.  All this works perfectly in the "page1.m" case=20
below and I see the desired output (the french characters) in my browsers.

But in the "page2.m" case, The $wrapped text hasn't been converted=20
correctly.  Interestingly, any text in the surrounding frame (i.e.,=20
frame.vm) is displayed correctly.

I came across some other posts in the past that eluded to a similar problem=
=20
but I'm stumped at this point.  Any ideas?

Thanks,
Dan


from maverick.xml
-------------------------------------------------------
                 <command name=3D"page1">
                         <controller class=3D"General">
                         </controller>
                         <view name=3D"success" path=3D"content.vm">
                         </view>
                 </command>

                 <command name=3D"page2">
                         <controller class=3D"General">
                         </controller>
                         <view name=3D"success" path=3D"content.vm">
                                 <transform path=3D"frame.vm"/>
                         </view>
         </command>


content.vm (stored as UTF-8)
------------------------------
Content: from french: =E0=E0=E0=E0


frame.vm (stored as UTF-8)
-----------------------------------
<html>
         <head>
                 <meta http-equiv=3D"Content-Type" content=3D"text/html;=20
charset=3DUTF-8">
         </head>
         <body>
                 <h1>
                         Header: from french: =E0=E0=E0=E0
                 </h1>
                 $wrapped
         </body>
</html>


output from page1.m
---------------------
Content: from french: =E0=E0=E0=E0   (NOTE This was displayed correctly)

output from page2.m
-------------------------
  Header: from french: =E0=E0=E0=E0  (NOTE This was displayed correctly)
Content: from french: =C3 =C3 =C3 =C3 (NOTE This was displayed INCORRECTLY)=
=20
--=====================_24586609==.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<body>
Hi --<br><br>
I am just trying to add some internalization support to my Maverick
application, which has been running flawlessly for years (!), and I ran
into a problem.&nbsp; What seems to happen is that the page that is to be
inserted into $wrapper goes through some undesired transformation.&nbsp;
I have configured Maverick to use UTF-8 via the defaultRequestCharset
parameter.&nbsp; I also configured Velocity to use UTF-8 for reading
templates with input.encoding=3DUTF-8 and for writing output with
output.encoding=3DUTF-8.&nbsp; All this works perfectly in the
&quot;page1.m&quot; case below and I see the desired output (the french
characters) in my browsers.<br><br>
But in the &quot;page2.m&quot; case, The $wrapped text hasn't been
converted correctly.&nbsp; Interestingly, any text in the surrounding
frame (i.e., frame.vm) is displayed correctly.<br><br>
I came across some other posts in the past that eluded to a similar
problem but I'm stumped at this point.&nbsp; Any ideas?<br><br>
Thanks,<br>
Dan<br><br>
<br>
from maverick.xml<br>
-------------------------------------------------------<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;command
name=3D&quot;page1&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;controller
class=3D&quot;General&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/controller&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;view
name=3D&quot;success&quot; path=3D&quot;content.vm&quot;&gt;<br>
&nbsp;&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;</x-tab>&lt;/view&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/command&gt;<br><br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;command
name=3D&quot;page2&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;controller
class=3D&quot;General&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/controller&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;view
name=3D&quot;success&quot; path=3D&quot;content.vm&quot;&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;</x-tab>&lt;transform
path=3D&quot;frame.vm&quot;/&gt;<br>
&nbsp;&nbsp;
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;</x-tab>&lt;/view&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/command&gt;<br><br>
<br>
content.vm (stored as UTF-8)<br>
------------------------------<br>
Content: from french: =E0=E0=E0=E0<br><br>
<br>
frame.vm (stored as UTF-8)<br>
-----------------------------------<br>
&lt;html&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;head&gt;<=
br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;meta
http-equiv=3D&quot;Content-Type&quot; content=3D&quot;text/html;
charset=3DUTF-8&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/head&gt;=
<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;body&gt;<=
br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;h1&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Header:
from french: =E0=E0=E0=E0<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/h1&gt;<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>$wrapped<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>&lt;/body&gt;=
<br>
&lt;/html&gt;<br><br>
<br>
output from page1.m<br>
---------------------<br>
Content: from french: =E0=E0=E0=E0&nbsp;&nbsp; (NOTE This was displayed
correctly)<br><br>
output from page2.m<br>
-------------------------<br>
&nbsp;Header: from french: =E0=E0=E0=E0&nbsp; (NOTE This was displayed
correctly)<br>
Content: from french: =C3 =C3 =C3 =C3 (NOTE This was displayed
INCORRECTLY)</body>
</html>

--=====================_24586609==.ALT--




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
[INVALID FOOTER]