Re: How to handle UTF-8 characters in struts ApplicationResources.properties

From: Oscar kind (oscar_at_danwa.net)
Date: 01/11/05


Date: Tue, 11 Jan 2005 19:37:32 +0100

ningjun.wang@lexisnexis.com wrote:
> I used WSAD5 and struts to develop a Japaness site using UTF-8. I
> defined error message in strut's ApplicationResources.properties file.
> If the error message contains Japaness characters (UTF-8 encoding), it
> will not be displayed correctly in the browser.
>
> For example ApplicationResources.properties contains the following:
>
> error.login.invalidCredential=?????: Your userName/password
> is invalid. Please try again.

Please note that a .properties file use the ISO 8859-1 character encoding,
so using UTF-8 characters in those files is not supported. See the
javadocs for java.util.RecourceBundle, java.util.PropertyResourceBundle
and java.util.Properties; especially this part:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding

BTW, struts uses java.util.Properies directly.

-- 
Oscar Kind                                    http://home.hccnet.nl/okind/
Software Developer                    for contact information, see website
PGP Key fingerprint:    91F3 6C72 F465 5E98 C246  61D9 2C32 8E24 097B B4E2


Relevant Pages

  • Re: New-Line in Regular Expression
    ... really good responses. ... > # Open the file for reading and if cannot die and give error message. ... > # While the file is open read through it and remove new line characters. ... > # For each item in the array print it out. ...
    (perl.beginners)
  • Re: New-Line in Regular Expression
    ... reason: POP3 Host did not acknowlege ... > # While the file is open read through it and remove new line characters. ... > # For each item in the array print it out. ... match the date field and the time field, and stored the exact log error message ...
    (perl.beginners)
  • Re: Access 2003 Combo problem
    ... that's why your getting the error message "Too Long" ... What's happening is that you are attempting to insert the Name, not the Abv ... characters long) and the two letter combination in the other field (2 ... Chuck Buckley ...
    (microsoft.public.access.formscoding)
  • Re: AutoRecover problem: "This is not a valid file name."
    ... That error message usually tells the truth: usually the path name is "not" ... Letters, numbers, and spaces are fine: any other characters will cause ... or a folder ... Unicode characters in NTFS, and of unlimited length in Mac ...
    (microsoft.public.mac.office.word)
  • RE: Repost - RunTime Error - Field too small
    ... Jet won't store changes to the external database in the table ... Here is the DLookup statement in the AfterUpdate event of the FacilityNumber ... If the name is longer that 30 characters, I get the error message. ...
    (microsoft.public.access.formscoding)