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/16 19:51:21 UTC

wrong characters when processed by clay

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:
<view>
 <!-- Base layout defintion  -->
 <component extends="clay" jsfid="basePage">
  <attributes>
   <set name="clayJsfid" value="/symbols/layout.html"/>
  </attributes>
  <symbols>
   <set name="@appName" value="App Name"/>
   <set name="@title" value="Default title"/>
   <set name="@leftColumn" value="/includes/leftMenu.html"/>
   <set name="@headercontent" value="/includes/header.html"/>
   <set name="@mainMenu" value="space"/>
   <set name="@bodycontent" value="space"/>
   <set name="@footer" value="/includes/footer.html"/>
  </symbols>
 </component>
</view>

clay-pages-config.xml:
<view>
 <!-- page definition -->
 <component extends="basePage" jsfid="/index.jsf">
  <symbols>
   <set name="@title" value="index page"/>
   <set name="@bodycontent" value="/pages/main.html"/>
  </symbols>
 </component>
...
</view>

and I use the @headercontent symbol in /symbols/layout.html like this:

...
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
</head>
...
<div id="header" class="clearfix">
        <c:clay    jsfid="clay"
            clayJsfid="@headercontent"
            allowBody="false">
        <h1>Mock header h1 element</h1>

        <h2>mock header subtitle</h2>
       
        <div id="branding"></div>
        <div id="user">user</div>
       
        </c:clay>
</div>
...


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


Re: wrong characters when processed by clay

Posted by Tomasz Pasierb <to...@poczta.fm>.
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.


Tomasz Pasierb napisaƂ(a):
> 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:
> <view>
> <!-- Base layout defintion  -->
> <component extends="clay" jsfid="basePage">
>  <attributes>
>   <set name="clayJsfid" value="/symbols/layout.html"/>
>  </attributes>
>  <symbols>
>   <set name="@appName" value="App Name"/>
>   <set name="@title" value="Default title"/>
>   <set name="@leftColumn" value="/includes/leftMenu.html"/>
>   <set name="@headercontent" value="/includes/header.html"/>
>   <set name="@mainMenu" value="space"/>
>   <set name="@bodycontent" value="space"/>
>   <set name="@footer" value="/includes/footer.html"/>
>  </symbols>
> </component>
> </view>
>
> clay-pages-config.xml:
> <view>
> <!-- page definition -->
> <component extends="basePage" jsfid="/index.jsf">
>  <symbols>
>   <set name="@title" value="index page"/>
>   <set name="@bodycontent" value="/pages/main.html"/>
>  </symbols>
> </component>
> ...
> </view>
>
> and I use the @headercontent symbol in /symbols/layout.html like this:
>
> ...
> <head>
>    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
> </head>
> ...
> <div id="header" class="clearfix">
>        <c:clay    jsfid="clay"
>            clayJsfid="@headercontent"
>            allowBody="false">
>        <h1>Mock header h1 element</h1>
>
>        <h2>mock header subtitle</h2>
>              <div id="branding"></div>
>        <div id="user">user</div>
>              </c:clay>
> </div>
> ...
>
>
> 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