You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Giorgos Zervas <gi...@perlfect.com> on 2005/01/12 13:35:51 UTC

resource bundle character set problem

hello list,

i am building a webapp that has to support greek characters.

i chose to encode my templates using utf-8, hence i set:
<property name="org.apache.tapestry.template-encoding" value="utf-8"/>
in my .application file.

greek characters that occur in the actual template a displayed correctly
in the browser. however internationalized messages pulled out of
properties files are displayed as gibberish. from what i understand in
3.0.1 properties files are read using the same encoding as the one
specified for html templates so I don't see where the problem could be -
both are utf-8. any help on resolving this problem would be extremely
appreciated.

on a related issue, i have a table component that displays rows of greek
text pulled out of a mysql database. the text shows up correctly in the
browser but in the actual html source i can see that it has been
transformed to html entities. this is not a problem per se but i don't
see why it should happen anyways.

thanks for your help,
giorgos

-- 
Giorgos Zervas <gi...@perlfect.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: resource bundle character set problem

Posted by Konstantin Iignatyev <kg...@yahoo.com>.
It should happen to prevent page html from corruption by textual data in 
your DB, lets say there is something like this "a<b" - that will 
confuse  browser a lot

Giorgos Zervas wrote:

>Andreas & Konstantin,
>
>Thanks for your help, it worked great.
>
>Do you by any chance have any ideas regarding my second question (below)
>as well?
>
>---
>
>on a related issue, i have a table component that displays rows of greek
>text pulled out of a mysql database. the text shows up correctly in the
>browser but in the actual html source i can see that it has been
>transformed to html entities. this is not a problem per se but i don't
>see why it should happen anyways.
>
>  
>


-- 
Thanks,

Konstantin Ignatyev

http://www.kgionline.com





PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2.700 tons of CFCs to the stratosphere, and increase their population by 263.000

Bowers, C.A.  The Culture of Denial:  
Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  
New York:  State University of New York Press, 1997: (4) (5) (p.206)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: resource bundle character set problem

Posted by Giorgos Zervas <gi...@perlfect.com>.
Andreas & Konstantin,

Thanks for your help, it worked great.

Do you by any chance have any ideas regarding my second question (below)
as well?

---

on a related issue, i have a table component that displays rows of greek
text pulled out of a mysql database. the text shows up correctly in the
browser but in the actual html source i can see that it has been
transformed to html entities. this is not a problem per se but i don't
see why it should happen anyways.

-- 
Giorgos Zervas <gi...@perlfect.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: resource bundle character set problem

Posted by Andreas Andreou <an...@di.uoa.gr>.
Giorgos, (for greek) just add the next line to your build.xml
        <native2ascii encoding="Cp1253" src="${web.src.dir}" 
dest="${web.build.dir}" includes="*.properties"/>

Konstantin Ignatyev wrote:

>No, Tapestry does not use the same encoding for
>reading property files( that was my wrong assumption
>too), but uses standard Java mechanic. That means you
>need to use native2ascii program in java or similarly
>names Ant task to convert your property files from
>UTF8 or whatever to that hardcoded charset. See
>javadocs for Properties for more information
> 
>--- Giorgos Zervas <gi...@perlfect.com> wrote:
>
>  
>
>>hello list,
>>
>>i am building a webapp that has to support greek
>>characters.
>>
>>i chose to encode my templates using utf-8, hence i
>>set:
>><property
>>name="org.apache.tapestry.template-encoding"
>>value="utf-8"/>
>>in my .application file.
>>
>>greek characters that occur in the actual template a
>>displayed correctly
>>in the browser. however internationalized messages
>>pulled out of
>>properties files are displayed as gibberish. from
>>what i understand in
>>3.0.1 properties files are read using the same
>>encoding as the one
>>specified for html templates so I don't see where
>>the problem could be -
>>both are utf-8. any help on resolving this problem
>>would be extremely
>>appreciated.
>>
>>on a related issue, i have a table component that
>>displays rows of greek
>>text pulled out of a mysql database. the text shows
>>up correctly in the
>>browser but in the actual html source i can see that
>>it has been
>>transformed to html entities. this is not a problem
>>per se but i don't
>>see why it should happen anyways.
>>
>>thanks for your help,
>>giorgos
>>
>>-- 
>>Giorgos Zervas <gi...@perlfect.com>
>>
>>
>>
>>    
>>
>---------------------------------------------------------------------
>  
>
>>To unsubscribe, e-mail:
>>tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>tapestry-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>=====
>Konstantin Ignatyev
>
>
>
>
>PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
>
>Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: resource bundle character set problem

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
No, Tapestry does not use the same encoding for
reading property files( that was my wrong assumption
too), but uses standard Java mechanic. That means you
need to use native2ascii program in java or similarly
names Ant task to convert your property files from
UTF8 or whatever to that hardcoded charset. See
javadocs for Properties for more information
 
--- Giorgos Zervas <gi...@perlfect.com> wrote:

> hello list,
> 
> i am building a webapp that has to support greek
> characters.
> 
> i chose to encode my templates using utf-8, hence i
> set:
> <property
> name="org.apache.tapestry.template-encoding"
> value="utf-8"/>
> in my .application file.
> 
> greek characters that occur in the actual template a
> displayed correctly
> in the browser. however internationalized messages
> pulled out of
> properties files are displayed as gibberish. from
> what i understand in
> 3.0.1 properties files are read using the same
> encoding as the one
> specified for html templates so I don't see where
> the problem could be -
> both are utf-8. any help on resolving this problem
> would be extremely
> appreciated.
> 
> on a related issue, i have a table component that
> displays rows of greek
> text pulled out of a mysql database. the text shows
> up correctly in the
> browser but in the actual html source i can see that
> it has been
> transformed to html entities. this is not a problem
> per se but i don't
> see why it should happen anyways.
> 
> thanks for your help,
> giorgos
> 
> -- 
> Giorgos Zervas <gi...@perlfect.com>
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


=====
Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org