You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Theodosios Paschalidis <th...@hotmail.com> on 2004/01/24 17:16:24 UTC

Validation for Unicode characters?

Hi all.

I am internationalizing my application and I was wondering whether the standard validators can be used with Unicode (greek) characters by the proper modification of the regular expression. Standard [a-z] expressions doesn't recognize unicode characters, throwing the predefined error. Is it possible to use the unicode escape sequence?in a \u????-\uXXXX manner?

Thank you,
Theo 

Re: Validation for Unicode characters? [Resolved]

Posted by Theodosios Paschalidis <th...@hotmail.com>.
Thank you Jason. The xml file didn't actually have a header but I added it
and it worked using the actual Greek characters (just remember to put in an
extra range for accented characters).

I noticed that "\w" (should match alpharithmetic or "_") did not work with
greek. I thought it matched Character.isLetterOrDigit() and as such a method
should work with unicode characters. Neverthelss "." and "\s" do work with
greek.

Hope this will be of help to somebody

Theo

----- Original Message ----- 
From: "Jason Lea" <ja...@kumachan.net.nz>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Saturday, January 24, 2004 9:48 PM
Subject: Re: Validation for Unicode characters?


> Theodosios Paschalidis wrote:
>
> >Hi all.
> >
> >I am internationalizing my application and I was wondering whether the
standard validators can be used with Unicode (greek) characters by the
proper modification of the regular expression. Standard [a-z] expressions
doesn't recognize unicode characters, throwing the predefined error. Is it
possible to use the unicode escape sequence?in a \u????-\uXXXX manner?
> >
> >Thank you,
> >Theo
> >
> >
> Assuming the struts regular expressions handle unicode correctly you
> should be able to use the actual greek characters in the validation.xml
> file.
>
> You will have to change the xml encoding from <?xml version="1.0"
> encoding="ISO-8859-1" ?> to something like <?xml version="1.0"
> encoding="UTF-8" ?> or greek encoding.  The ISO-8859-1 encoding is the
> standard ascii characters and so international characters are not
supported.
>
> The \uXXXX format is used only in the .properties files, not in .xml.
>
>
> -- 
> Jason Lea
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

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


Re: Validation for Unicode characters?

Posted by Jason Lea <ja...@kumachan.net.nz>.
Theodosios Paschalidis wrote:

>Hi all.
>
>I am internationalizing my application and I was wondering whether the standard validators can be used with Unicode (greek) characters by the proper modification of the regular expression. Standard [a-z] expressions doesn't recognize unicode characters, throwing the predefined error. Is it possible to use the unicode escape sequence?in a \u????-\uXXXX manner?
>
>Thank you,
>Theo 
>  
>
Assuming the struts regular expressions handle unicode correctly you 
should be able to use the actual greek characters in the validation.xml 
file.

You will have to change the xml encoding from <?xml version="1.0" 
encoding="ISO-8859-1" ?> to something like <?xml version="1.0" 
encoding="UTF-8" ?> or greek encoding.  The ISO-8859-1 encoding is the 
standard ascii characters and so international characters are not supported.

The \uXXXX format is used only in the .properties files, not in .xml.


-- 
Jason Lea



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