match validator doens't work with unicode

I developed a site on localhost and it’s worked fine. When I uploaded to the server, the match validator doesn’t work as supposed.

validator code:




array('tags', 'match', 'pattern'=>'/^[\w\s?\,?]+$/u', 'message'=>'Cuvintele cheie pot conţine doar cifre sau litere şi trebuiesc separate cu spaţiu sau virgulă'),



I included the /[color="#FF0000"]u[/color], also I tried including




mb_internal_encoding("UTF-8"); 

mb_regex_encoding('UTF-8');



withous success.

On localhost everything works fine, I can include [color="#FF0000"]ă î â ţ ş[/color] in tags, on the server the validator doesn’t let thru the words containing the above characters.

What can be the problem?

Try using the Unicode expressions:

http://www.php.net/manual/en/regexp.reference.unicode.php

I’ve tried these things without success. (=unicode characters are treated as symbols) Is there a php setting (eg. in ini) that prevents things functioning as expected??? I can’t figure out what can be the source of the problem…

Before matching try to process your tags with something like this


mb_convert_encoding('your_tag','UTF-8')