You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonathan Bélisle <jo...@rcda.ca> on 2007/04/19 22:12:06 UTC

html entities conversion

Hi,

I would like to know how to encode html entities present in resource file.

Example : home_fr.properties

msg01=numéro

It should print "num&eacute;ro" when i look at the html source in my 
browser.
If I put num&eacute;ro directly in the resource file, tapestry encode 
the & to &amp; so I get "num&eacute;ro" at the screen.

How do I make Tapestry encode my resource files this way.

Thanks, Jonathan.



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


Re: html entities conversion

Posted by Julian Wood <wo...@ucalgary.ca>.
I think you should write your properties files in UTF-8, tell  
tapestry to read them using UTF-8, output your html as UTF-8 and be  
sure to include the appropriate meta tag <meta http-equiv="Content- 
Type" content="text/html;charset=UTF-8" /> in your web pages too.

http://tapestry.apache.org/tapestry4.1/usersguide/localization.html

Then you don't need to deal with entities.

Of course, you could just use ISO-8859-1 instead of UTF-8 in all the  
above places too, to get the same effect, for latin-based languages.  
The key is to pay attention to the charset you're using, in all  
places where you're dealing with text data for output.

J

On 19-Apr-07, at 2:12 PM, Jonathan Bélisle wrote:

> Hi,
>
> I would like to know how to encode html entities present in  
> resource file.
>
> Example : home_fr.properties
>
> msg01=numéro
>
> It should print "num&eacute;ro" when i look at the html source in  
> my browser.
> If I put num&eacute;ro directly in the resource file, tapestry  
> encode the & to &amp; so I get "num&eacute;ro" at the screen.
>
> How do I make Tapestry encode my resource files this way.
>
> Thanks, Jonathan.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

--
Julian Wood <wo...@ucalgary.ca>

Software Engineer
Teaching & Learning Centre
University of Calgary

http://tlc.ucalgary.ca