You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ken McArthur <ke...@fgood.org> on 2006/01/04 16:22:00 UTC

utf-8 from resource bundle?

Hi,

All my pages start with <%@page pageEncoding="utf-8" contentType="text/html;
charset=utf-8" %>
and have <meta http-equiv="content-type" content="text/html; charset=utf-8">
in the html head tag.

Output from all database derived unicode characters look fine.  However,
output from resource bundle is garbled.  i.e. "Español" comes back as "Espa&
#195;&#177;ol".  File check on resource properties file comes back returns
UTF-8 Unicode English text, with very long lines.  Any ideas what I'm doing
wrong or what more I need to add?

Thanks,
Ken

Re: utf-8 from resource bundle?

Posted by Alin Dosoniu <ad...@hotmail.com>.
This is how I solve the problem:
into resource files I write the Unicode of special charcters.
So, for your Español I write in msg_es.properties something like this Espa\uUnicode_Code_for_ñol.
You can use native2ascii tool to convert a properties file from Español to Espa\uUnicode_Code_for_ñol.

Hope this helps,
Alin.

  By the way, I'm using Tomcat 5 where I set URIEncoding="UTF-8" in the Connector tag.
  Also have a catch all filter setting.
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");

  All is good except for display of content from my ResourceBundle.

  I'd really appreciate any ideas any one may have.

  Thanks,
  Ken



  On 1/4/06, Ken McArthur <ke...@fgood.org> wrote:

    Hi,

    All my pages start with <%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
    and have <meta http-equiv="content-type" content="text/html; charset=utf-8"> in the html head tag.

    Output from all database derived unicode characters look fine.  However, output from resource bundle is garbled.  i.e. "Español" comes back as "Espa&#195;&#177;ol".  File check on resource properties file comes back returns UTF-8 Unicode English text, with very long lines.  Any ideas what I'm doing wrong or what more I need to add?

    Thanks,
    Ken




Re: utf-8 from resource bundle?

Posted by Ken McArthur <ke...@fgood.org>.
By the way, I'm using Tomcat 5 where I set URIEncoding="UTF-8" in the
Connector tag.
Also have a catch all filter setting.
      request.setCharacterEncoding("utf-8");
      response.setCharacterEncoding("utf-8");

All is good except for display of content from my ResourceBundle.

I'd really appreciate any ideas any one may have.

Thanks,
Ken


On 1/4/06, Ken McArthur <ke...@fgood.org> wrote:
>
>
> Hi,
>
> All my pages start with <%@page pageEncoding="utf-8"
> contentType="text/html; charset=utf-8" %>
> and have <meta http-equiv="content-type" content="text/html;
> charset=utf-8"> in the html head tag.
>
> Output from all database derived unicode characters look fine.  However,
> output from resource bundle is garbled.  i.e. "Español" comes back as
> "Espa&#195;&#177;ol".  File check on resource properties file comes back
> returns UTF-8 Unicode English text, with very long lines.  Any ideas what
> I'm doing wrong or what more I need to add?
>
> Thanks,
> Ken
>
>

Re: utf-8 from resource bundle?

Posted by Ken McArthur <ke...@fgood.org>.
Got it working. Thanks a ton.


On 1/4/06, xzuma <za...@gmail.com> wrote:
>
> ResourceBundles need to be converted by native2ascii before use. The
> ResourceBundle Editor plugin for Eclipse does this conversion automatically.
>
> On 1/4/06, Ken McArthur <ke...@fgood.org> wrote:
> >
> >
> > Hi,
> >
> > All my pages start with <%@page pageEncoding="utf-8"
> > contentType="text/html; charset=utf-8" %>
> > and have <meta http-equiv="content-type" content="text/html;
> > charset=utf-8"> in the html head tag.
> >
> > Output from all database derived unicode characters look fine.  However,
> > output from resource bundle is garbled.  i.e. "Español" comes back as
> > "Espa&#195;&#177;ol".  File check on resource properties file comes back
> > returns UTF-8 Unicode English text, with very long lines.  Any ideas what
> > I'm doing wrong or what more I need to add?
> >
> > Thanks,
> > Ken
> >
> >
>

Re: utf-8 from resource bundle?

Posted by xzuma <za...@gmail.com>.
ResourceBundles need to be converted by native2ascii before use. The
ResourceBundle Editor plugin for Eclipse does this conversion automatically.

On 1/4/06, Ken McArthur <ke...@fgood.org> wrote:
>
>
> Hi,
>
> All my pages start with <%@page pageEncoding="utf-8"
> contentType="text/html; charset=utf-8" %>
> and have <meta http-equiv="content-type" content="text/html;
> charset=utf-8"> in the html head tag.
>
> Output from all database derived unicode characters look fine.  However,
> output from resource bundle is garbled.  i.e. "Español" comes back as
> "Espa&#195;&#177;ol".  File check on resource properties file comes back
> returns UTF-8 Unicode English text, with very long lines.  Any ideas what
> I'm doing wrong or what more I need to add?
>
> Thanks,
> Ken
>
>