Page 1 of 1

Convert Unicode value to ASCII value for use in Query

Posted: Tue Sep 25, 2007 4:10 am
by iainfreestone
i have a function that returns a value in Unicode format. When I try and make a MySQL select statement with the Unicoce value it does not work.

So I need to change this Unicode value into a ASCII value that I can use in my database query.

Any help would be greatly appeciacted

Regards

Iain.

Posted: Tue Sep 25, 2007 8:22 am
by lnt
1. Create database in utf8_unicode_ci

2. Set Name UTF8
//open connection
//...
mysql_query('SET NAMES utf8;');

3. Set multibyte internal encoding
mb_internal_encoding("UTF-8");

Now you can work correctly with unicode string and database