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. What seems to happen is that the page that is to be
inserted into $wrapper goes through some undesired transformation.
I have configured Maverick to use UTF-8 via the defaultRequestCharset
parameter. 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. All this works perfectly in the
"page1.m" case below and I see the desired output (the french
characters) in my browsers.<br><br>
But in the "page2.m" case, The $wrapped text hasn't been
converted correctly. 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. Any ideas?<br><br>
Thanks,<br>
Dan<br><br>
<br>
from maverick.xml<br>
-------------------------------------------------------<br>
<x-tab> </x-tab><x-tab> =
</x-tab><command
name=3D"page1"><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab><controller
class=3D"General"><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab></controller><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab><view
name=3D"success" path=3D"content.vm"><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab></view><br>
<x-tab> </x-tab> &=
nbsp;
</command><br><br>
<x-tab> </x-tab><x-tab> =
</x-tab><command
name=3D"page2"><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab><controller
class=3D"General"><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab></controller><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab><view
name=3D"success" path=3D"content.vm"><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab><x-tab> &n=
bsp; </x-tab><transform
path=3D"frame.vm"/><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab></view><br>
</command><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>
<html><br>
<x-tab> </x-tab><head><=
br>
<x-tab> </x-tab><x-tab> =
</x-tab><meta
http-equiv=3D"Content-Type" content=3D"text/html;
charset=3DUTF-8"> <br>
<x-tab> </x-tab></head>=
<br>
<x-tab> </x-tab><body><=
br>
<x-tab> </x-tab><x-tab> =
</x-tab><h1><br>
<x-tab> </x-tab><x-tab> =
</x-tab><x-tab> &=
nbsp; </x-tab>Header:
from french: =E0=E0=E0=E0<br>
<x-tab> </x-tab><x-tab> =
</x-tab></h1><br>
<x-tab> </x-tab><x-tab> =
</x-tab>$wrapped<br>
<x-tab> </x-tab></body>=
<br>
</html><br><br>
<br>
output from page1.m<br>
---------------------<br>
Content: from french: =E0=E0=E0=E0 (NOTE This was displayed
correctly)<br><br>
output from page2.m<br>
-------------------------<br>
Header: from french: =E0=E0=E0=E0 (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]