Page 1 of 1

How i can add UTF support

Posted: Sun Apr 29, 2007 6:58 am
by staar2
I have problems with this expression ([A-Za-z]+) how can i add here Estonian special chars ?
Like this ([A-Za-zöüõä]+) ?

Posted: Sun Apr 29, 2007 8:32 am
by Ollie Saunders
I think something like this:

Code: Select all

preg_match( '~[\x{4378}-\x{5642}a-z]+~ui', $stuff);
will match unicode code points. Test it though.

Posted: Tue May 01, 2007 3:35 pm
by staar2
hmm didn't get work, it dosen't allow to insert chars like this äüõö :oops:

Posted: Tue May 01, 2007 3:59 pm
by Ollie Saunders
Make sure you are using the u pattern modifier and try just typing those characters in. Also make sure your source code file is UTF-8 (if it is indeed UTF-8 and not another UTF) and the input you are operating on is as well.