On Wed, April 11, 2007 6:47 am, Man-wai Chang wrote:
> how do you do string comparison in utf-8? say the user entered a
> chinese
> string the browser and you need to search for the string in the MySQL
> table using PHP.

*IF*
the page that got the initial data was UTF-8 in its HTTP Headers and
in the META tags, and
mysql server is starting up with UTF-8, and
php mysql client connnection is using UTF-8, and
the page getting the search key is also UTf-8, then

it should "just work" I think...

That said...

If you're still having problems with this one broken character in a
specific charset, you're on the wrong list...

It's possible that you need WHERE binary field = '$input'
MySQL has a "binary" keyword for binary comparison.
But it may have some OTHER keyword for UTf-8 comparison...
I dunno.  Ask a MySQL list.

There's no actual PHP in your question...

I'll stop typing now.

And stop taking cold medicine too.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to