views:

160

answers:

2

Recently I worked in a project in where I need to display japanese text which are come from database. I already use

meta http-equiv="Content-Type" content="text/html; charset=utf-8"

It help to display the static text. But when it come from database it display "??????????" type text.

How can I solve this kind of problem?

+1  A: 

Is the database charset UTF8 too? Is the connection charset UTF8? Seems like the data gets converted to ISO-8859-1 somewhere along the way.

Without more information, it is hard to find exactly what the problem is. What DBMS are you using? MySQL? PostgreSQL? Either way, I'm pretty sure either your database and/or your connection isn't using UTF8.

You can change your connection charset by using one of the following functions:

mysql_set_charset('UTF-8');
pg_set_client_encoding('UTF-8');
Andrew Moore
Database MySQL. I use UTF8 in database.
Arif
Then use `mysql_set_charset()` to make the connection **UTF-8**.
Andrew Moore
it is Not working.
Arif
Check the database locale and table locale.
Andrew Moore
A: 

Thanks it worked......

Kunal Khaware