Reply to Re: How to determine if a file is UTF8 encoded?

Your name:

Reply:


Posted by Chung Leong on 11/18/05 21:02

Ewoud Dronkert wrote:
> Chung Leong wrote:
> > echo preg_match('/./u', $text);
>
> That will match on any single utf8 character, which could potentially be
> followed by non-utf8 data... Also, I'm not sure about its behaviour when
> encountering such data.
>
> --
> E. Dronkert

PCRE validates the string before it runs the expression.

pcre.c:8037
if (valid_utf8((uschar *)subject, length) >= 0)
return PCRE_ERROR_BADUTF8;

If it isn't valid all the way through, then there's no match.

[Back to original 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

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