Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts - validating foreign characters

Reply
Thread Tools

Struts - validating foreign characters

 
 
mdjj
Guest
Posts: n/a
 
      03-31-2006
I need to validate my web app to allow both english and european
characters (anything else I'll reject). I can do it by allowing
individual characters in the mask i.e.

>From validation.xml :


<constant>
<constant-name>alphaForeignCheck</constant-name>
<constant-value>^[a-zA-Z \s]*$</constant-value>
</constant>

This will allow for alphas and . But rather than list individual
foreign characters is there a way to group say all french all german
characters?

 
Reply With Quote
 
 
 
 
Oliver Wong
Guest
Posts: n/a
 
      03-31-2006

"mdjj" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> I need to validate my web app to allow both english and european
> characters (anything else I'll reject). I can do it by allowing
> individual characters in the mask i.e.
>
> >From validation.xml :

>
> <constant>
> <constant-name>alphaForeignCheck</constant-name>
> <constant-value>^[a-zA-Z \s]*$</constant-value>
> </constant>
>
> This will allow for alphas and . But rather than list individual
> foreign characters is there a way to group say all french all german
> characters?


Unicode code charts are at: http://www.unicode.org/charts/

You'll probably want \u00c0 to \u00FF, except not \u00f7 and \u00d7. You
might want to also look at Latin Extended A and Latin Extended B.

Perhaps you can save yourself a lot of effort and do the validation in Java,
via Character.isLetter()

- Oliver

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Survey - implementing CRUD with "foreign name" instead of foreign key. H5N1 ASP .Net 0 05-03-2006 11:36 PM
Foreign Characters & ASP.net tatemononai@gmail.com ASP .Net 1 08-22-2005 07:09 PM
Foreign Characters & Web User Controls tatemononai@gmail.com ASP .Net 0 07-30-2005 07:05 AM
Foreign Alphabet Characters nta@pipeline.com Firefox 1 10-31-2004 06:47 PM
problem with writing a batch file with foreign characters rachel cox Java 1 02-03-2004 08:30 AM



Advertisments