You are here: Re: [PHP] preg for unicode strings? « PHP « IT news, forums, messages
Re: [PHP] preg for unicode strings?

Posted by "Richard Lynch" on 10/14/36 11:31

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация