Thank you for your answer Gary.

I've tried <local-encoding-mapping-list> element in web.xml and using a filter, both with no luck (tried it without shale, just pure jsf myfaces). I have even tried the solution proposed at facelets mailing list (they suggest putting an encoding attribute within f:view element, myfaces complains however) - they say it works - but I haven't had luck with it either.

As it appears it's the problem of JSF not specifically shale-clay. Myfaces escapes every character that is not ascii to html entity and uft-8 two-byte characters become two seperate characters encoded as html entities - those characters are not converted properly because jsf doesn't seem to know the page is utf-8. If I used pure jsps I would add the line '<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" language="java" %>' at the top of each jsp and then jsf impl would know it's utf-8 and convert the characters to correct entities (they would still be html entities but this time they would render correctly). This in fact works. But with shale-clay composition features I cannot use this line as those are html files.

I guess it's the problem of myfaces but as I'm trying to use shale clay's composition features and there the html files as "tiles" I wonder if any of you guys could suggest what I can do to have the myfaces-shale-clay combo display utf-8 encoded files correctly.

Is there an equivalent in clay for the line I could use in regular jsp to set the page encoding.
Any hope for me in thei matter :-) ???

Regards,
Tom Pasierb

Gary VanMatre napisał(a):
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

------------------------------------------------------------------------
Szybko i tanio ubezpiecz samochod! Kupno polisy zajmie Ci 15 minut! Kontakt przez telefon albo Internet. Kliknij i sprawdz: http://link.interia.pl/f19a0

Reply via email to