>From: Tomasz Pasierb <[EMAIL PROTECTED]>
>
> Could you guys tell me how I would use clay's "tiles" defined in html
> and saved in encoding different than iso-8859-1 and make clay display
> those correctly when included in final layout? I need to use characters
> from either utf-8 or iso-8859-2 codepages and so far had no luck.
>
I'm not sure if I know the answer to this one but I'm going to take a guess.
I *think* what is going on is that Clay uses the servlet request's default
encoding.
This happens in the ViewHandler. The line of code looks like the following:
//create a buffered response writer
ResponseWriter buffResponsewriter =
context.getRenderKit().createResponseWriter(writer, null,
response.getCharacterEncoding());
Shale requires servlet 2.4 so you might try the new encoding stuff in the
web.xml to set the default request encoding.
<local-encoding-mapping-list>
<local-encoding-mapping>
<locale>ja</locale>
<encoding>Shift_JIS</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>zh_TW</locale>
<encoding>Big5</encoding>
</locale-encoding-mapping>
</locale-encoding-mapping-list>
You can also do this with a filter. One of the shale preprocess filter
commands might work nicely
(http://shale.apache.org/features-application-manager.html).
I've looked through the template parsing and I didn't see a place that was
doing anything with encoding. If the above suggestion doesn't work, please
create a JIRA ticket and attach a template example
(http://shale.apache.org/issue-tracking.html).
>
> Tomasz Pasierb napisaÅ(a):
Gary
> > Hello,
> >
> > I'm a shale newbie. I'm learning it and experimenting with it :-)
> >
> > I've recently run into a problem I cannot solve.
> >
> > I've configured clay to use its tiles-like features. My config files
> > look like the following:
> >
> > clay-symbols-config.xml:
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > clay-pages-config.xml:
> >
> >
> >
> >
> >
> >
> >
> >
> > ...
> >
> >
> > and I use the @headercontent symbol in /symbols/layout.html like this:
> >
> > ...
> >
> >
> >
> > ...
> >
> > > > clayJsfid="@headercontent"
> > allowBody="false">
> >
Mock header h1 element
> >
> >
mock header subtitle
> >
> >
user
> >
> >
> > ...
> >
> >
> > Both /symbols/layout.html and /includes/header.html are saved with
> > UTF-8 encoding. The /includes/header.html file gets included in the
> > final output that's generated by clay. The problem is that in
> > header.html there are Polish characters, which are saved using two
> > bytes. When I view the file in my browser directly the charaters are
> > displayed correctly but when the page is run on the server and thus
> > processed by clay the characters are not displayed right, they are
> > converted to html entities somewhere along the way and are displayed
> > as two disctinct characters in the browser.
> >
> > Could you please tell me how I can make clay include files with utf-8
> > encoding in the final output so that all the charaters are displayed
> > as they are supposed to. When reading files does clay somehow check
> > their encoding? Is there an atrribute that would make clay not escape
> > those characters?
> >
> > Thanks,
> > Tom Pasierb
> >
> > ------------------------------------------------------------------------
> > Szybko i tanio ubezpiecz samochod! Kupno polisy zajmie Ci 15 minut!
> > Kontakt przez telefon albo Internet. Kliknij i sprawdz:
> > http://link.interia.pl/f19a0
> >
> >
> >
>
> ------------------------------------------------------------------------
> Szybko i tanio ubezpiecz samochod!
> Kupno polisy zajmie Ci 15 minut! Kontakt przez telefon albo Internet.
> Kliknij i sprawdz: http://link.interia.pl/f19a0
>