You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Brian Long <br...@gmail.com> on 2006/01/31 15:18:32 UTC

Euro Symbol Localisation

Hi,

I'm using .properties files in WEB-INF for localisation and using
<span key="some_text"/> on the html pages to generate the relevant
text for the users locale. I am however having a small problem at the
moment with the euro symbol €, when this is placed in the .properties
file, it is rendered as ? on the actual html page by tapestry.

I suspect encoding is the problem, but I'm none the wiser as to how I
would 'escape' this character in the .properties file so that it would
be displayed correctly on the subsequent web page.

Any feedback, comments or suggestions would be welcome . . .

/Brian.

Re: Euro Symbol Localisation

Posted by Brian Long <br...@gmail.com>.
That worked a treat, thanks!

/Brian.

Re: Euro Symbol Localisation

Posted by Sam Gendler <sg...@ideasculptor.com>.
Try compiling and running this in your production environment to see
what your defaultCharset is set to.  As far as I can tell, there is NO
way to modify it after the JVM has started up.

import java.nio.charset.Charset;
public class charset {
    public static void main(String[] args) {
        System.out.println(Charset.defaultCharset().displayName());
    }
}


On 5/5/06, Sam Gendler <sg...@ideasculptor.com> wrote:
> Have you guys tried just using "-Dfile.encoding=UTF-8" when you run
> the jvm which will run your app server (include it in JAVA_OPTS if you
> run tomcat).  That causes java to use UTF-8 as the charset for all
> incoming and outgoing content by default.  Otherwise, you have to
> explicitly set the charset for every Reader and Writer you use, which
> is impossible to do without re-writing large chunks of Tapestry
> itself.  I haven't had any issues with non-ascii characters in either
> direction since I added that to my JAVA_OPTS and I had plenty of
> problems before because the default charset in java on OS X was
> MacRoman rather than UTF-8.
>
> --sam
>
>
> On 5/5/06, Brian Long <br...@gmail.com> wrote:
> > Hi Lubos,
> >
> > I received your suggested 'filter' solution a couple of months ago in
> > response to a problem I was having with tapestry and UTF-8, I didn't use it
> > afterwards as I just used an image instead of the desired text, but now that
> > I'm internationalising my web application, I'd like to fix this problem for
> > once and for all.
> >
> > I've tried/attempted your solution, but to no avail, perhaps you could take
> > a quick look at my implementation and check to see that I haven't done
> > something stupid!
> >
> > Regards, Brian.
> >
> > In web.xml (just the relevant entries are shown)
> > <web-app>
> >     <context-param>
> >         <param-name>PARAMETER_ENCODING</param-name>
> >         <param-value>UTF-8</param-value>
> >     </context-param>
> >
> >     <filter>
> >         <filter-name>meta-filter</filter-name>
> >         <filter-class>com.mycompany.MetaFilter</filter-class>
> >     </filter>
> >
> >     <filter-mapping>
> >         <servlet-name>my_project</servlet-name>
> >         <filter-name>meta-filter</filter-name>
> >     </filter-mapping>
> >
> >      <servlet-mapping>
> >          <servlet-name>my_project</servlet-name>
> >          <url-pattern>/app</url-pattern>
> >      </servlet-mapping>
> >
> > </web-app>
> >
> > The filter class I created based on your example . . .
> >
> >
> > package com.mycompany;
> >
> > import java.io.IOException;
> >
> > import javax.servlet.Filter;
> > import javax.servlet.FilterChain;
> > import javax.servlet.FilterConfig;
> > import javax.servlet.ServletException;
> > import javax.servlet.ServletRequest;
> > import javax.servlet.ServletResponse;
> > import javax.servlet.http.HttpServletRequest;
> >
> > public class MetaFilter implements Filter {
> >
> >     FilterConfig config;
> >
> >     public void init(FilterConfig config)
> >     {
> >         this.config = config;
> >     }
> >
> >      public void doFilter(ServletRequest servletRequest, ServletResponse
> >              servletResponse,
> >                         FilterChain filterChain) throws IOException,
> > ServletException {
> >               try  {
> >                   HttpServletRequest httpServletRequest =
> > (HttpServletRequest)
> >              servletRequest;
> >                         servletRequest.setCharacterEncoding("UTF-8");
> >                         servletResponse.setContentType( "text/html;
> > charset=UTF-8" );
> >               } finally {
> >                   //do nothing;
> >               }
> >      }
> >
> >     public void destroy() {
> >
> >     }
> >
> >
> > }
> >
> > I'm sure I missing something in the above, the httpServletRequest I create
> > is never read/used, perhaps you could give me some pointers as to how I
> > would finish off this class?
> >
> > Thanks again for all your help . . .
> >
> > On 1/31/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
> > >
> > > I had the same problem with Tapestry 3.02 and I think it is still in 4.0.
> > > Somehow
> > > Tapestry doesnt' set up content type properly. Looking at html source from
> > > Tapestry,
> > > the <meta> for content type is not the first <meta> but the second <meta>
> > > in
> > > the <header>.
> > > I have read somewhere, that content type <meta> must be the first in
> > > <header> otherwise it is ignore.
> > >
> > > I came with workaround. I use web-app <filter> and in that I force utf-8:
> > >
> > > public void doFilter(ServletRequest servletRequest, ServletResponse
> > > servletResponse,
> > >             FilterChain filterChain) throws IOException, ServletException
> > > {
> > >   try  {
> > >       HttpServletRequest httpServletRequest = (HttpServletRequest)
> > > servletRequest;
> > >             servletRequest.setCharacterEncoding("UTF-8");
> > >             servletResponse.setContentType( "text/html; charset=UTF-8" );
> > >
> > >
> > > It is ugly but it works.
> > >
> > > Lubos
> > >
> > >
> >
> >
>

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


Re: Euro Symbol Localisation

Posted by Sam Gendler <sg...@ideasculptor.com>.
Have you guys tried just using "-Dfile.encoding=UTF-8" when you run
the jvm which will run your app server (include it in JAVA_OPTS if you
run tomcat).  That causes java to use UTF-8 as the charset for all
incoming and outgoing content by default.  Otherwise, you have to
explicitly set the charset for every Reader and Writer you use, which
is impossible to do without re-writing large chunks of Tapestry
itself.  I haven't had any issues with non-ascii characters in either
direction since I added that to my JAVA_OPTS and I had plenty of
problems before because the default charset in java on OS X was
MacRoman rather than UTF-8.

--sam


On 5/5/06, Brian Long <br...@gmail.com> wrote:
> Hi Lubos,
>
> I received your suggested 'filter' solution a couple of months ago in
> response to a problem I was having with tapestry and UTF-8, I didn't use it
> afterwards as I just used an image instead of the desired text, but now that
> I'm internationalising my web application, I'd like to fix this problem for
> once and for all.
>
> I've tried/attempted your solution, but to no avail, perhaps you could take
> a quick look at my implementation and check to see that I haven't done
> something stupid!
>
> Regards, Brian.
>
> In web.xml (just the relevant entries are shown)
> <web-app>
>     <context-param>
>         <param-name>PARAMETER_ENCODING</param-name>
>         <param-value>UTF-8</param-value>
>     </context-param>
>
>     <filter>
>         <filter-name>meta-filter</filter-name>
>         <filter-class>com.mycompany.MetaFilter</filter-class>
>     </filter>
>
>     <filter-mapping>
>         <servlet-name>my_project</servlet-name>
>         <filter-name>meta-filter</filter-name>
>     </filter-mapping>
>
>      <servlet-mapping>
>          <servlet-name>my_project</servlet-name>
>          <url-pattern>/app</url-pattern>
>      </servlet-mapping>
>
> </web-app>
>
> The filter class I created based on your example . . .
>
>
> package com.mycompany;
>
> import java.io.IOException;
>
> import javax.servlet.Filter;
> import javax.servlet.FilterChain;
> import javax.servlet.FilterConfig;
> import javax.servlet.ServletException;
> import javax.servlet.ServletRequest;
> import javax.servlet.ServletResponse;
> import javax.servlet.http.HttpServletRequest;
>
> public class MetaFilter implements Filter {
>
>     FilterConfig config;
>
>     public void init(FilterConfig config)
>     {
>         this.config = config;
>     }
>
>      public void doFilter(ServletRequest servletRequest, ServletResponse
>              servletResponse,
>                         FilterChain filterChain) throws IOException,
> ServletException {
>               try  {
>                   HttpServletRequest httpServletRequest =
> (HttpServletRequest)
>              servletRequest;
>                         servletRequest.setCharacterEncoding("UTF-8");
>                         servletResponse.setContentType( "text/html;
> charset=UTF-8" );
>               } finally {
>                   //do nothing;
>               }
>      }
>
>     public void destroy() {
>
>     }
>
>
> }
>
> I'm sure I missing something in the above, the httpServletRequest I create
> is never read/used, perhaps you could give me some pointers as to how I
> would finish off this class?
>
> Thanks again for all your help . . .
>
> On 1/31/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
> >
> > I had the same problem with Tapestry 3.02 and I think it is still in 4.0.
> > Somehow
> > Tapestry doesnt' set up content type properly. Looking at html source from
> > Tapestry,
> > the <meta> for content type is not the first <meta> but the second <meta>
> > in
> > the <header>.
> > I have read somewhere, that content type <meta> must be the first in
> > <header> otherwise it is ignore.
> >
> > I came with workaround. I use web-app <filter> and in that I force utf-8:
> >
> > public void doFilter(ServletRequest servletRequest, ServletResponse
> > servletResponse,
> >             FilterChain filterChain) throws IOException, ServletException
> > {
> >   try  {
> >       HttpServletRequest httpServletRequest = (HttpServletRequest)
> > servletRequest;
> >             servletRequest.setCharacterEncoding("UTF-8");
> >             servletResponse.setContentType( "text/html; charset=UTF-8" );
> >
> >
> > It is ugly but it works.
> >
> > Lubos
> >
> >
>
>

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


Re: Euro Symbol Localisation

Posted by Brian Long <br...@gmail.com>.
Hi Lubos,

I received your suggested 'filter' solution a couple of months ago in
response to a problem I was having with tapestry and UTF-8, I didn't use it
afterwards as I just used an image instead of the desired text, but now that
I'm internationalising my web application, I'd like to fix this problem for
once and for all.

I've tried/attempted your solution, but to no avail, perhaps you could take
a quick look at my implementation and check to see that I haven't done
something stupid!

Regards, Brian.

In web.xml (just the relevant entries are shown)
<web-app>
    <context-param>
        <param-name>PARAMETER_ENCODING</param-name>
        <param-value>UTF-8</param-value>
    </context-param>

    <filter>
        <filter-name>meta-filter</filter-name>
        <filter-class>com.mycompany.MetaFilter</filter-class>
    </filter>

    <filter-mapping>
        <servlet-name>my_project</servlet-name>
        <filter-name>meta-filter</filter-name>
    </filter-mapping>

     <servlet-mapping>
         <servlet-name>my_project</servlet-name>
         <url-pattern>/app</url-pattern>
     </servlet-mapping>

</web-app>

The filter class I created based on your example . . .


package com.mycompany;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

public class MetaFilter implements Filter {

    FilterConfig config;

    public void init(FilterConfig config)
    {
        this.config = config;
    }

     public void doFilter(ServletRequest servletRequest, ServletResponse
             servletResponse,
                        FilterChain filterChain) throws IOException,
ServletException {
              try  {
                  HttpServletRequest httpServletRequest =
(HttpServletRequest)
             servletRequest;
                        servletRequest.setCharacterEncoding("UTF-8");
                        servletResponse.setContentType( "text/html;
charset=UTF-8" );
              } finally {
                  //do nothing;
              }
     }

    public void destroy() {

    }


}

I'm sure I missing something in the above, the httpServletRequest I create
is never read/used, perhaps you could give me some pointers as to how I
would finish off this class?

Thanks again for all your help . . .

On 1/31/06, Lubos and Alena Pochman <po...@gmail.com> wrote:
>
> I had the same problem with Tapestry 3.02 and I think it is still in 4.0.
> Somehow
> Tapestry doesnt' set up content type properly. Looking at html source from
> Tapestry,
> the <meta> for content type is not the first <meta> but the second <meta>
> in
> the <header>.
> I have read somewhere, that content type <meta> must be the first in
> <header> otherwise it is ignore.
>
> I came with workaround. I use web-app <filter> and in that I force utf-8:
>
> public void doFilter(ServletRequest servletRequest, ServletResponse
> servletResponse,
>             FilterChain filterChain) throws IOException, ServletException
> {
>   try  {
>       HttpServletRequest httpServletRequest = (HttpServletRequest)
> servletRequest;
>             servletRequest.setCharacterEncoding("UTF-8");
>             servletResponse.setContentType( "text/html; charset=UTF-8" );
>
>
> It is ugly but it works.
>
> Lubos
>
>

Re: Euro Symbol Localisation

Posted by Lubos and Alena Pochman <po...@gmail.com>.
I had the same problem with Tapestry 3.02 and I think it is still in 4.0.
Somehow
Tapestry doesnt' set up content type properly. Looking at html source from
Tapestry,
the <meta> for content type is not the first <meta> but the second <meta> in
the <header>.
I have read somewhere, that content type <meta> must be the first in
<header> otherwise it is ignore.

I came with workaround. I use web-app <filter> and in that I force utf-8:

 public void doFilter(ServletRequest servletRequest, ServletResponse
servletResponse,
            FilterChain filterChain) throws IOException, ServletException {
  try  {
      HttpServletRequest httpServletRequest = (HttpServletRequest)
servletRequest;
            servletRequest.setCharacterEncoding("UTF-8");
            servletResponse.setContentType( "text/html; charset=UTF-8" );


It is ugly but it works.

Lubos

On 1/31/06, Jérôme BERNARD <je...@gmail.com> wrote:
>
> Usually you should suspect somewhere a wrong encoding used through the
> flow
> of your system.
>
> Check the following points:
> - is your database storing content in UTF-8 (should you use one)?
> - are your Tapestry templates written in UTF-8 and specifying a proper
> content type (<*meta* http-equiv="Content-Type" content="text/*html*
> ;charset=*utf-8*" />)?
> - your properties files encodings (you just did).
>
> Have a look at
> http://java.sun.com/developer/EJTechTips/2005/tt1220.html#2for
> more details.
>
> Regards,
> Jérôme.
>
> On 1/31/06, Brian Long <br...@gmail.com> wrote:
> >
> > Jérôme,
> >
> > Good question, I'm using XP SP2 and the file was created from eclipse
> > using new file -> myproject.properties. I went back and checked to see
> > what encoding eclipse was using for the *.properties files and found
> > that these are encoded as ISO-8859-1by default, so I changed this to
> > UTF-8. Stopped tomcat, crossed my fingers, counted to ten, rubbed my
> > lucky rabbits foot then restarted the application, but when I checked
> > the page, same familiar sight!
> >
> > So in summary, previously I haven't been using a UTF-8 encoded file,
> > but even when I do, I still get a € to ? conversion . . .
> >
> > >Brian.
>

Re: Euro Symbol Localisation

Posted by Jérôme BERNARD <je...@gmail.com>.
Usually you should suspect somewhere a wrong encoding used through the flow
of your system.

Check the following points:
- is your database storing content in UTF-8 (should you use one)?
- are your Tapestry templates written in UTF-8 and specifying a proper
content type (<*meta* http-equiv="Content-Type" content="text/*html*
;charset=*utf-8*" />)?
- your properties files encodings (you just did).

Have a look at http://java.sun.com/developer/EJTechTips/2005/tt1220.html#2for
more details.

Regards,
Jérôme.

On 1/31/06, Brian Long <br...@gmail.com> wrote:
>
> Jérôme,
>
> Good question, I'm using XP SP2 and the file was created from eclipse
> using new file -> myproject.properties. I went back and checked to see
> what encoding eclipse was using for the *.properties files and found
> that these are encoded as ISO-8859-1by default, so I changed this to
> UTF-8. Stopped tomcat, crossed my fingers, counted to ten, rubbed my
> lucky rabbits foot then restarted the application, but when I checked
> the page, same familiar sight!
>
> So in summary, previously I haven't been using a UTF-8 encoded file,
> but even when I do, I still get a € to ? conversion . . .
>
> >Brian.

Re: Euro Symbol Localisation

Posted by Brian Long <br...@gmail.com>.
Jérôme,

Good question, I'm using XP SP2 and the file was created from eclipse
using new file -> myproject.properties. I went back and checked to see
what encoding eclipse was using for the *.properties files and found
that these are encoded as ISO-8859-1by default, so I changed this to
UTF-8. Stopped tomcat, crossed my fingers, counted to ten, rubbed my
lucky rabbits foot then restarted the application, but when I checked
the page, same familiar sight!

So in summary, previously I haven't been using a UTF-8 encoded file,
but even when I do, I still get a € to ? conversion . . .

>Brian.

Re: Euro Symbol Localisation

Posted by Jérôme BERNARD <je...@gmail.com>.
Are you really sure that you .properties file is written using an UTF-8
encoding and nothing fancy like a windows encoding?

Regards,
Jérôme.

On 1/31/06, Brian Long <br...@gmail.com> wrote:
>
> Martin,
>
> No joy, same problem, € becomes ? and "&euro;" becomes "&amp;euro;" . . .
>
> Looks like I'll be using EURO (so long as tapestry doesn't try convert
> it into YEN)!
>
> Thanks, Brian.
>
> On 1/31/06, Martin Strand <ma...@entcap.se> wrote:
> > Perhaps you need to specify the *.properties file encoding. Put this in
> > your *.application config:
> >
> > <meta key="org.apache.tapestry.properties-encoding" value="UTF-8"/>
> >
> > --Martin
> >
> > On Tue, 31 Jan 2006 16:00:07 +0100, Brian Long <brian.long.msc@gmail.com
> >
> > wrote:
> >
> > > Gary,
> > > same problem really, when tapestry sees "&euro;" in the
> .propertiesfile
> > > it converts the ampersand to &amp; so I get something like
> thefollowing
> > > in my .html page
> > > <h2>The price is &amp;euro;</h2>
> > > same problem for &#8364; etc.
> > > So I have to figure out how to escape the € symbol (or the & symbol)or
> > > tapestry will continue to 'help' me by converting them intowhatever
> > > encoding format it's using.
> > > /Brian.
> > > On 1/31/06, Gary Pampara <gp...@cs.up.ac.za> wrote:> Gary Pampara
> > > wrote:> > Brian Long wrote:> >> Hi,> >>> >> I'm using .properties
> files
> > > in WEB-INF for localisation and using> >> <span key="some_text"/> on
> the
> > > html pages to generate the relevant> >> text for the users locale. I
> am
> > > however having a small problem at the> >> moment with the euro symbol
> €,
> > > when this is placed in the .properties> >> file, it is rendered as ?
> on
> > > the actual html page by tapestry.> >>> >> I suspect encoding is the
> > > problem, but I'm none the wiser as to how I> >> would 'escape' this
> > > character in the .properties file so that it would> >> be displayed
> > > correctly on the subsequent web page.> >>> >> Any feedback, comments
> or
> > > suggestions would be welcome . . .> >>> >> /Brian.> >>> >> > Use the
> > > correct html. I think it is something like: |&euro;> >> > ||Gary|> >
> ||>
> > > >> >
> > > --------------------------------------------------------------------->
> >
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org>
> >
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> > > >>> Sorry thats: &euro;>>
> > > --------------------------------------------------------------------->
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> > > -- MailScannerEmail Virus ScannerEntcap ABwww.entcap.se
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>

[T3] Components in a loop

Posted by Sergiy Kyrylkov <ky...@sac.com.ua>.
Hi,

I have a list of items.  For each item I have to select a property from the
set of the predefined values.

If I just needed to display the items and the set of values I could have had
something like this:

<tr jwcid="@Foreach" source="ognl:itemList" value="ognl:item" element="tr">
	<td><span jwcid="@Insert" value="ognl:item.getItemString()"/></td>
	<td><span jwcid="selectProperty" size="5"/></td>
</tr>

<component id=" selectProperty " type="PropertySelection">
    	<binding name="model" expression="propertyModel"/>
	<binding name="value" expression="property"/>
</component>

Now since I need to both set initially selected values and read newly
selected values from PropertySelection component I need ListEdit component
instead of Foreach.  

My question is: is there a way to iterate through both Insert and
PropertySelection components while rendering the page (setting values) and
through PropertySelection components while rewinding the page (reading
values) without packing the item/value object pair into a wrapper object?
As far as I understand there is no other way to make it work with
ListEditMap.

Is there a more elegant solution?

Sergiy

=====================
Multiplex Systems LLC
http://www.mpxsys.com
=====================


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


Re: Euro Symbol Localisation

Posted by Brian Long <br...@gmail.com>.
Martin,

No joy, same problem, € becomes ? and "&euro;" becomes "&amp;euro;" . . .

Looks like I'll be using EURO (so long as tapestry doesn't try convert
it into YEN)!

Thanks, Brian.

On 1/31/06, Martin Strand <ma...@entcap.se> wrote:
> Perhaps you need to specify the *.properties file encoding. Put this in
> your *.application config:
>
> <meta key="org.apache.tapestry.properties-encoding" value="UTF-8"/>
>
> --Martin
>
> On Tue, 31 Jan 2006 16:00:07 +0100, Brian Long <br...@gmail.com>
> wrote:
>
> > Gary,
> > same problem really, when tapestry sees "&euro;" in the .propertiesfile
> > it converts the ampersand to &amp; so I get something like thefollowing
> > in my .html page
> > <h2>The price is &amp;euro;</h2>
> > same problem for &#8364; etc.
> > So I have to figure out how to escape the € symbol (or the & symbol)or
> > tapestry will continue to 'help' me by converting them intowhatever
> > encoding format it's using.
> > /Brian.
> > On 1/31/06, Gary Pampara <gp...@cs.up.ac.za> wrote:> Gary Pampara
> > wrote:> > Brian Long wrote:> >> Hi,> >>> >> I'm using .properties files
> > in WEB-INF for localisation and using> >> <span key="some_text"/> on the
> > html pages to generate the relevant> >> text for the users locale. I am
> > however having a small problem at the> >> moment with the euro symbol €,
> > when this is placed in the .properties> >> file, it is rendered as ? on
> > the actual html page by tapestry.> >>> >> I suspect encoding is the
> > problem, but I'm none the wiser as to how I> >> would 'escape' this
> > character in the .properties file so that it would> >> be displayed
> > correctly on the subsequent web page.> >>> >> Any feedback, comments or
> > suggestions would be welcome . . .> >>> >> /Brian.> >>> >> > Use the
> > correct html. I think it is something like: |&euro;> >> > ||Gary|> > ||>
> > >> >
> > ---------------------------------------------------------------------> >
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org> >
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org>
> > >>> Sorry thats: &euro;>>
> > --------------------------------------------------------------------->
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org>>
> > -- MailScannerEmail Virus ScannerEntcap ABwww.entcap.se
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Euro Symbol Localisation

Posted by Martin Strand <ma...@entcap.se>.
Perhaps you need to specify the *.properties file encoding. Put this in  
your *.application config:

<meta key="org.apache.tapestry.properties-encoding" value="UTF-8"/>

--Martin

On Tue, 31 Jan 2006 16:00:07 +0100, Brian Long <br...@gmail.com>  
wrote:

> Gary,
> same problem really, when tapestry sees "&euro;" in the .propertiesfile  
> it converts the ampersand to &amp; so I get something like thefollowing  
> in my .html page
> <h2>The price is &amp;euro;</h2>
> same problem for &#8364; etc.
> So I have to figure out how to escape the € symbol (or the & symbol)or  
> tapestry will continue to 'help' me by converting them intowhatever  
> encoding format it's using.
> /Brian.
> On 1/31/06, Gary Pampara <gp...@cs.up.ac.za> wrote:> Gary Pampara  
> wrote:> > Brian Long wrote:> >> Hi,> >>> >> I'm using .properties files  
> in WEB-INF for localisation and using> >> <span key="some_text"/> on the  
> html pages to generate the relevant> >> text for the users locale. I am  
> however having a small problem at the> >> moment with the euro symbol €,  
> when this is placed in the .properties> >> file, it is rendered as ? on  
> the actual html page by tapestry.> >>> >> I suspect encoding is the  
> problem, but I'm none the wiser as to how I> >> would 'escape' this  
> character in the .properties file so that it would> >> be displayed  
> correctly on the subsequent web page.> >>> >> Any feedback, comments or  
> suggestions would be welcome . . .> >>> >> /Brian.> >>> >> > Use the  
> correct html. I think it is something like: |&euro;> >> > ||Gary|> > ||>  
> >> >  
> ---------------------------------------------------------------------> >  
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org> >  
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org>  
> >>> Sorry thats: &euro;>>  
> --------------------------------------------------------------------->  
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org>  
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org>>
> -- MailScannerEmail Virus ScannerEntcap ABwww.entcap.se
>
>



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


Re: Euro Symbol Localisation

Posted by Brian Long <br...@gmail.com>.
Gary,

same problem really, when tapestry sees "&euro;" in the .properties
file it converts the ampersand to &amp; so I get something like the
following in my .html page

<h2>The price is &amp;euro;</h2>

same problem for &#8364; etc.

So I have to figure out how to escape the € symbol (or the & symbol)
or tapestry will continue to 'help' me by converting them into
whatever encoding format it's using.

/Brian.

On 1/31/06, Gary Pampara <gp...@cs.up.ac.za> wrote:
> Gary Pampara wrote:
> > Brian Long wrote:
> >> Hi,
> >>
> >> I'm using .properties files in WEB-INF for localisation and using
> >> <span key="some_text"/> on the html pages to generate the relevant
> >> text for the users locale. I am however having a small problem at the
> >> moment with the euro symbol €, when this is placed in the .properties
> >> file, it is rendered as ? on the actual html page by tapestry.
> >>
> >> I suspect encoding is the problem, but I'm none the wiser as to how I
> >> would 'escape' this character in the .properties file so that it would
> >> be displayed correctly on the subsequent web page.
> >>
> >> Any feedback, comments or suggestions would be welcome . . .
> >>
> >> /Brian.
> >>
> >
> > Use the correct html. I think it is something like: |&euro;
> >
> > ||Gary|
> > ||
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
>
> Sorry thats: &euro;
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Euro Symbol Localisation

Posted by Andreas Andreou <an...@di.uoa.gr>.
If you try this, use:
<span key="some_text" raw="ognl:true"/>

>>
>> Use the correct html. I think it is something like: |&euro;
>>
>> ||Gary|
>> ||
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>
> Sorry thats: &euro;
>
> ---------------------------------------------------------------------
> 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: Euro Symbol Localisation

Posted by Gary Pampara <gp...@cs.up.ac.za>.
Gary Pampara wrote:
> Brian Long wrote:
>> Hi,
>>
>> I'm using .properties files in WEB-INF for localisation and using
>> <span key="some_text"/> on the html pages to generate the relevant
>> text for the users locale. I am however having a small problem at the
>> moment with the euro symbol €, when this is placed in the .properties
>> file, it is rendered as ? on the actual html page by tapestry.
>>
>> I suspect encoding is the problem, but I'm none the wiser as to how I
>> would 'escape' this character in the .properties file so that it would
>> be displayed correctly on the subsequent web page.
>>
>> Any feedback, comments or suggestions would be welcome . . .
>>
>> /Brian.
>>   
> 
> Use the correct html. I think it is something like: |&euro;
> 
> ||Gary|
> ||
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 

Sorry thats: &euro;

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


Re: Euro Symbol Localisation

Posted by Gary Pampara <gp...@cs.up.ac.za>.
Brian Long wrote:
> Hi,
>
> I'm using .properties files in WEB-INF for localisation and using
> <span key="some_text"/> on the html pages to generate the relevant
> text for the users locale. I am however having a small problem at the
> moment with the euro symbol €, when this is placed in the .properties
> file, it is rendered as ? on the actual html page by tapestry.
>
> I suspect encoding is the problem, but I'm none the wiser as to how I
> would 'escape' this character in the .properties file so that it would
> be displayed correctly on the subsequent web page.
>
> Any feedback, comments or suggestions would be welcome . . .
>
> /Brian.
>   

Use the correct html. I think it is something like: |&euro;

||Gary|
||

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