applicationresources.properties with utf-8 characters

View: New views
10 Messages — Rating Filter:   Alert me  

applicationresources.properties with utf-8 characters

by deligeli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

I would like to have in my applicationresources.properties utf-8 charcters.
When I write:
login.notRecognized = "נא לנסות שנית"

and try to save, I get the message
Some characters cannot be mapped using ISO-8859-1

What tag can I add to it?

It's a properties file..

Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by Lukasz Lenart :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What do you use to edit that file? Eclipse? There is plugin which will
convert in fly characters to UTF-8 entities, Resource Bundle Editor or
something. IntelliJ IDEA has built-in such option, just select it in
Settings.


Regards
--
Lukasz
http://www.lenart.org.pl/
http://dailylog.lenart.org.pl/

Rita Rudner  - "I was a vegetarian until I started leaning toward the
sunlight." - http://www.brainyquote.com/quotes/authors/r/rita_rudner.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by stoupa91devel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

use native2ascii to convert the foreign characters into \uNNNN escape
sequence.

look at here
http://globalizer.wordpress.com/2007/02/08/property-resource-bundle-encoding/

martin



Odelya YomTov wrote:

> Hi!
>
> I would like to have in my applicationresources.properties utf-8 charcters.
> When I write:
> login.notRecognized = "נא לנסות שנית"
>
> and try to save, I get the message
> Some characters cannot be mapped using ISO-8859-1
>
> What tag can I add to it?
>
> It's a properties file..
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by Yanto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Change the file properties, file type to utf8
On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:

> Hi!
>
> I would like to have in my applicationresources.properties utf-8 charcters.
> When I write:
> login.notRecognized = "נא לנסות שנית"
>
> and try to save, I get the message
> Some characters cannot be mapped using ISO-8859-1
>
> What tag can I add to it?
>
> It's a properties file..
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by Wes Wannemacher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 01 July 2009 21:03:32 Yanto wrote:
> Change the file properties, file type to utf8
>

I am pretty sure that properties files can't be utf-8. I think you are stuck
with iso-8859-1. I've run into this before and the proper solution is what was
suggested earlier, using the native2ascii tool.

-Wes

> On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:
> > Hi!
> >
> > I would like to have in my applicationresources.properties utf-8
> > charcters. When I write:
> > login.notRecognized = "נא לנסות שנית"
> >
> > and try to save, I get the message
> > Some characters cannot be mapped using ISO-8859-1
> >
> > What tag can I add to it?
> >
> > It's a properties file..
> >
> > Thanks!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@...
> > For additional commands, e-mail: user-help@...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by Wes Wannemacher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 01 July 2009 21:03:32 Yanto wrote:
> Change the file properties, file type to utf8
>

I am pretty sure that you can only use ISO-8859-1 for properties files. I ran
into this once before and the accepted solution is to use the native2ascii
tool as was previously suggested.

-Wes

> On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:
> > Hi!
> >
> > I would like to have in my applicationresources.properties utf-8
> > charcters. When I write:
> > login.notRecognized = "נא לנסות שנית"
> >
> > and try to save, I get the message
> > Some characters cannot be mapped using ISO-8859-1
> >
> > What tag can I add to it?
> >
> > It's a properties file..
> >
> > Thanks!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@...
> > For additional commands, e-mail: user-help@...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...

--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by Yanto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We change applicationresources_zh.properties to utf 8 in our application,
and the application can show the chinese character properly in the
application.
However we are not changing applicationresources.properties to utf8

On Thu, Jul 2, 2009 at 10:49 AM, Wes Wannemacher <wesw@...> wrote:

> On Wednesday 01 July 2009 21:03:32 Yanto wrote:
> > Change the file properties, file type to utf8
> >
>
> I am pretty sure that you can only use ISO-8859-1 for properties files. I
> ran
> into this once before and the accepted solution is to use the native2ascii
> tool as was previously suggested.
>
> -Wes
>
> > On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:
> > > Hi!
> > >
> > > I would like to have in my applicationresources.properties utf-8
> > > charcters. When I write:
> > > login.notRecognized = "נא לנסות שנית"
> > >
> > > and try to save, I get the message
> > > Some characters cannot be mapped using ISO-8859-1
> > >
> > > What tag can I add to it?
> > >
> > > It's a properties file..
> > >
> > > Thanks!
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@...
> > > For additional commands, e-mail: user-help@...
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@...
> > For additional commands, e-mail: user-help@...
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>

Re: applicationresources.properties with utf-8 characters

by Wes Wannemacher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not going to argue about whether or not it will work, but if you
look at the Javadocs for java.util.Properties ->

http://java.sun.com/javase/6/docs/api/java/util/Properties.html

It does specifically state the the input (and output) streams are
iso-8859-1 and that unicode chars should use the \u0000 generated by
the native2ascii tool. If another method works for you, that's good,
but I would proceed with caution because you might just be lucky right
now and screwed the next time you upgrade your jre/jdk.

-Wes

On Thu, Jul 2, 2009 at 1:19 AM, Yanto<yantobong@...> wrote:

> We change applicationresources_zh.properties to utf 8 in our application,
> and the application can show the chinese character properly in the
> application.
> However we are not changing applicationresources.properties to utf8
>
> On Thu, Jul 2, 2009 at 10:49 AM, Wes Wannemacher <wesw@...> wrote:
>
>> On Wednesday 01 July 2009 21:03:32 Yanto wrote:
>> > Change the file properties, file type to utf8
>> >
>>
>> I am pretty sure that you can only use ISO-8859-1 for properties files. I
>> ran
>> into this once before and the accepted solution is to use the native2ascii
>> tool as was previously suggested.
>>
>> -Wes
>>
>> > On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:
>> > > Hi!
>> > >
>> > > I would like to have in my applicationresources.properties utf-8
>> > > charcters. When I write:
>> > > login.notRecognized = "נא לנסות שנית"
>> > >
>> > > and try to save, I get the message
>> > > Some characters cannot be mapped using ISO-8859-1
>> > >
>> > > What tag can I add to it?
>> > >
>> > > It's a properties file..
>> > >
>> > > Thanks!
>> > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: user-unsubscribe@...
>> > > For additional commands, e-mail: user-help@...
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@...
>> > For additional commands, e-mail: user-help@...
>>
>> --
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@...
>> For additional commands, e-mail: user-help@...
>>
>>
>



--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: applicationresources.properties with utf-8 characters

by Greg Lindholm-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This question comes up often so here are some references:

Take a look at the JavaDoc for Properties [1] and PropertyResourceBundle
[2].  They both state that the properties file must be encoded in ISO 8859-1
with Unicode escapes when the file is loaded from an input stream.

Internally Struts calls ResourceBundle.getBundle() [3] to load the bundle
(properties files) which loads them from an input stream.  So if you use
standard Struts facilities to manage your properties bundles then you must
encode them in ISO 8859-1.

[1] http://java.sun.com/javase/6/docs/api/java/util/Properties.html
[2]
http://java.sun.com/javase/6/docs/api/java/util/PropertyResourceBundle.html
[3]
http://java.sun.com/javase/6/docs/api/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale,%20java.lang.ClassLoader)

On Thu, Jul 2, 2009 at 1:19 AM, Yanto <yantobong@...> wrote:

> We change applicationresources_zh.properties to utf 8 in our application,
> and the application can show the chinese character properly in the
> application.
> However we are not changing applicationresources.properties to utf8
>
> On Thu, Jul 2, 2009 at 10:49 AM, Wes Wannemacher <wesw@...> wrote:
>
> > On Wednesday 01 July 2009 21:03:32 Yanto wrote:
> > > Change the file properties, file type to utf8
> > >
> >
> > I am pretty sure that you can only use ISO-8859-1 for properties files. I
> > ran
> > into this once before and the accepted solution is to use the
> native2ascii
> > tool as was previously suggested.
> >
> > -Wes
> >
> > > On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:
> > > > Hi!
> > > >
> > > > I would like to have in my applicationresources.properties utf-8
> > > > charcters. When I write:
> > > > login.notRecognized = "נא לנסות שנית"
> > > >
> > > > and try to save, I get the message
> > > > Some characters cannot be mapped using ISO-8859-1
> > > >
> > > > What tag can I add to it?
> > > >
> > > > It's a properties file..
> > > >
> > > > Thanks!
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@...
> > > > For additional commands, e-mail: user-help@...
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@...
> > > For additional commands, e-mail: user-help@...
> >
> > --
> > Wes Wannemacher
> > Author - Struts 2 In Practice
> > Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> > http://www.manning.com/wannemacher
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@...
> > For additional commands, e-mail: user-help@...
> >
> >
>

Re: applicationresources.properties with utf-8 characters

by Yanto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

we haven't go to very detail...just test in some label..and we did encounter
in some others pages it come with weird character...after read your link, I
would rather follow the standard, rather than have issue in the future :)

On Thu, Jul 2, 2009 at 9:40 PM, Wes Wannemacher <wesw@...> wrote:

> I'm not going to argue about whether or not it will work, but if you
> look at the Javadocs for java.util.Properties ->
>
> http://java.sun.com/javase/6/docs/api/java/util/Properties.html
>
> It does specifically state the the input (and output) streams are
> iso-8859-1 and that unicode chars should use the \u0000 generated by
> the native2ascii tool. If another method works for you, that's good,
> but I would proceed with caution because you might just be lucky right
> now and screwed the next time you upgrade your jre/jdk.
>
> -Wes
>
> On Thu, Jul 2, 2009 at 1:19 AM, Yanto<yantobong@...> wrote:
> > We change applicationresources_zh.properties to utf 8 in our application,
> > and the application can show the chinese character properly in the
> > application.
> > However we are not changing applicationresources.properties to utf8
> >
> > On Thu, Jul 2, 2009 at 10:49 AM, Wes Wannemacher <wesw@...>
> wrote:
> >
> >> On Wednesday 01 July 2009 21:03:32 Yanto wrote:
> >> > Change the file properties, file type to utf8
> >> >
> >>
> >> I am pretty sure that you can only use ISO-8859-1 for properties files.
> I
> >> ran
> >> into this once before and the accepted solution is to use the
> native2ascii
> >> tool as was previously suggested.
> >>
> >> -Wes
> >>
> >> > On Thursday, July 2, 2009, Odelya YomTov <odelya@...> wrote:
> >> > > Hi!
> >> > >
> >> > > I would like to have in my applicationresources.properties utf-8
> >> > > charcters. When I write:
> >> > > login.notRecognized = "נא לנסות שנית"
> >> > >
> >> > > and try to save, I get the message
> >> > > Some characters cannot be mapped using ISO-8859-1
> >> > >
> >> > > What tag can I add to it?
> >> > >
> >> > > It's a properties file..
> >> > >
> >> > > Thanks!
> >> > >
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: user-unsubscribe@...
> >> > > For additional commands, e-mail: user-help@...
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@...
> >> > For additional commands, e-mail: user-help@...
> >>
> >> --
> >> Wes Wannemacher
> >> Author - Struts 2 In Practice
> >> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> >> http://www.manning.com/wannemacher
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@...
> >> For additional commands, e-mail: user-help@...
> >>
> >>
> >
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
>