[Mav-user] Incorrect char encoding with $wrapper
Dan Finkelstein
Fri, 22 Jul 2005 15:19:46 -0700
Hi --
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=UTF-8 and for writing output with
output.encoding=UTF-8. All this works perfectly in the
"page1.m" case 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 correctly. Interestingly, any text in the surrounding
frame (i.e., frame.vm) is displayed correctly.
I came across some other posts in the past that eluded to a similar
problem but I'm stumped at this point. Any ideas?
Thanks,
Dan
from maverick.xml
-------------------------------------------------------
<command
name="page1">
<controller
class="General">
</controller>
<view
name="success" path="content.vm">
</view>
</command>
<command
name="page2">
<controller
class="General">
</controller>
<view
name="success" path="content.vm">
<transform
path="frame.vm"/>
</view>
</command>
content.vm (stored as UTF-8)
------------------------------
Content: from french: àààà
frame.vm (stored as UTF-8)
-----------------------------------
<html>
<head>
<meta
http-equiv="Content-Type" content="text/html;
charset=UTF-8">
</head>
<body>
<h1>
Header:
from french: àààà
</h1>
$wrapped
</body>
</html>
output from page1.m
---------------------
Content: from french: àààà (NOTE This was displayed
correctly)
output from page2.m
-------------------------
Header: from french: àààà (NOTE This was displayed
correctly)
Content: from french: Ã Ã Ã Ã (NOTE This was displayed
INCORRECTLY)