Re: preg for unicode strings?
| From: | Richard Lynch | Date: | Tue, 08 Nov 2005 23:50:36 +0000 |
| Subject: | Re: preg for unicode strings? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-225338@lists.php.net to get a copy of this message | ||
On Sat, November 5, 2005 3:02 pm, Andy Pieters wrote:
> Hi List
>
> I am doing some data validation and the following regexp fails
>
> [\W]
>
> When using characters like £ or â¬
>
> Obviously because they are technically more then one character, even
> though
> they are only displayed as one.
>
> The script is encoded in UTF-8
>
> Anybody know a fix for this?
You could use http://php.net/utf8_decode on it first, and
then
validate...
I dunno if that would allow any nasties to get past, but it least it
should validate the input as "legal" I think...
I always feel overwhelmed by all this multi-lingual character-encoding
multi-byte stuff, frankly.
--
Like Music?
http://l-i-e.com/artists.htm