From: David Vallner Date: 2006-12-17T05:15:15+09:00 Subject: Re: newb: Rails character encoding and validation --------------enig227A3DBF4A250C1E04B278E6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable David Vallner wrote: > Luciano Ramalho wrote: >> It is not really viable to validade a name field with a regex if you >> are willing to accept Unicode characters. The only reasonable >> validation is to check whether the field is empty. >> >=20 > It is so viable. Just not using [a-zA-Z]. >=20 > Character classes are your friend. >=20 For clarification: I am unsure just how well Ruby's regexp engine handles Unicode "extended latin" characters, a trivial test using $KCODE =3D 'u', require 'jcode', and iconv failed for me. But that could be me getting the codepages wrong. The above is just saying that there is nothing saying that a regexp engine properly supporting Unicode and character classes would be unsuitable to validate non-ASCII text. David Vallner --------------enig227A3DBF4A250C1E04B278E6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFhFPNy6MhrS8astoRAqi/AJ0Qs7jp3tz6v+jbnK3wsOr5RBZhTwCeOgxJ +WsL5eKtUFkeeccAfzHGbEM= =tSrh -----END PGP SIGNATURE----- --------------enig227A3DBF4A250C1E04B278E6--