You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Tomasz Pasierb <to...@poczta.fm> on 2006/09/23 15:16:06 UTC

phypical files' encoding

Hello,

Could any of you guys explain how I can use the shale-clay composition 
features with html tiles that are encoded in utf-8 or any other encoding 
than iso-8859-1?

 From what I have found so far it seems that it's actually a problem of 
jsp spec and tomcat implementation (or the fact that it strictly 
implements the spec). With html templates I have no option of setting 
the pageEncoding or contentType page directives (those apply to jsps). 
I've got shale configured to proccess *.html and *.faces requests. 
Underneath all those requests go through jasper (when deployed on 
tomcat). Jasper reads the tile (html), and as it cannot find the page 
directives that would make it set encoding to utf-8 it defaults to 
iso-8859-1 (jsp spec) which as I've found I cannot change. As a result 
the utf-8 encoded file is read as iso-8859-1 and garbage is displayed on 
screen. The solution would probably be to set uft-8 as the default 
encoding for jasper but that's not JSP specification compliant as Craig 
McClanahan stated here: 
http://mail-archives.apache.org/mod_mbox/tomcat-dev/200105.mbox/%3cPine.BSF.4.21.0105120906580.54618-100000@localhost%3e. 


During my "investigation" I found that I could use the switch 
-Dfile.encoding=utf-8 which actually makes tomcat use utf-8 encoding 
internally and myfaces doesn't convert non-ascii characters to html 
entities any longer but  those characters are still not converted 
correctly when they are read from hdd.

I've tried filtering all requests and in my desparation ;-) I've set 
both request's and response's characterEncoding to utf-8 and response's 
contentType to "text/html;charset=utf-8" but it doesn't seem to work.

I've tried the following thing on tomcat to actually check this:
I prepared a utf-8 encoded html file with non-ascii characters. I viewed 
this page with standard tomcat web.xml and server.xml settings plus the 
-Dfile.encoding=utf-8 option. The page was read by tomcat correctly from 
disk and displayed correctly in the browser. Then I mapped the *.html 
extension to jsp servlet. When I requested the page, the response had 
the wrong characters in it and was not displayed correctly in the browser.

Is there any solution to this problem? Please tell me those composition 
features of shale-clay can actually be used with something else than 
iso-8859-1.

Maybe an configuration option could be introduced in shale for encoding 
that would be used when shale generates jsps dynamically (the page 
directive). I guess this would make the problem go away.

Regards,
Tom Pasierb

----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e