Re: Struts - validating foreign characters




"mdjj" <m_d_j_j@xxxxxxxxxxxxx> wrote in message news:1143802582.882434.100950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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

.



Relevant Pages

  • Re: Schleife =?iso-8859-15?Q?=FCber_die_Codepoints?=
    ... the question that matters most to most readers: What changes do you have to make to your application in order to support supplementary characters? ... The answer depends on what kind of text processing is done within the application and which Java platform APIs are used. ... Applications that deal with text only in the form of char sequences in all forms, and only use Java APIs that accept and return such char sequences, will likely not have to make any changes. ... Applications that interpret individual characters themselves, pass individual characters to Java platform APIs, or call methods that return ...
    (de.comp.lang.java)
  • Re: splitting words into individual characters
    ... I am trying to break a word down into individual characters. ... I'm trying to break down the file permissions into individual ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: Radial text on a path
    ... > except the output to printer is a bit shaky. ... print "rotated" text characters using the Printer.Print method). ... do you want the individual characters of the "circular" text to be normally ... True Type fonts print out very crisply on high resolution output devices ...
    (microsoft.public.vb.general.discussion)
  • Re: Fantasy characters which are not black and white?
    ... characters, which is one reason that I like them a lot (especially ... I didn't want to read an 800 page book about 4 individual characters. ... same reason that many other people consider them a bit of a letdown ... from books two and three. ...
    (rec.arts.sf.written)
  • Re: C getchar() functionality in Ada
    ... I've found that the Get and Get_Line functions ignore linefeeds. ... *still* not going to be reading and writing individual characters the ... outside the standard Ada library. ... If you really want to read individual characters and treat ...
    (comp.lang.ada)