View Full Version : charset
sujith787
09-08-2007, 11:19 PM
in my PHP Mysql data base i have a table.
the table field values are in UNICODE FONT. (eg:. எடுத்து காட்டு.) this is UNICODE TAMIL FONT. but when i retrive that same data from the table the output come like this ?????????????????????? . what is the problem. wht i have to do for this is there any collation type to display the UNICODE fonts correctly? i tried UTF8_UNICODE_ci collation.
please sort out this problem.
i tried by changing the php.ini file
default_charset = "utf-8"
PHP doesn't handle multibyte characters well. There are some hacks to attempt to implement it (such as the mbstring extension) but it would be much easier to go with a different language.
sujith787
09-08-2007, 11:41 PM
but, i get error only with the text which comes from database.
in the same page. the other texts (static texts) are display correctly
sujith787
09-09-2007, 12:44 AM
when i see the database the text display correctly. when i get that same text in my php page it comes like "?????????????????????????????"
in the same page i have same unicode static text they comes good in php
Have you executed:
mysql_query('set names \'utf-8\'')before querying your database?
sujith787
09-10-2007, 12:20 AM
thank you mr twey.
i didnt do that. actually i dont know whts that.
can u please tell me where i have to do that. how i have to excecute it plz tell me
It's a simple PHP statement... put it after connecting to your database and before executing your UTF-8 queries.
sujith787
09-10-2007, 07:05 PM
thank you twey.
i tried this also. but didnt get anything.
iam entering datas directly in the database.
the text in database table is correct.
but when i retrive it in php page i get error.
http://brownjoint.com/tamilsource/website/tsmagazine/test.php
this is the link in this page
"விளம்பரம்...." and "மனிதனின் தலையில்................................"
both are static text whih i am getting correctly..
in the right side top we have text like " ??????????????????? 1" and
" ????????????? 2"
this text iam getting from mysql data base. but in database this are "வணக்கம் 1" and " நன்றி 2"
but when i get this text in php page in output it comes like "?????????? 1" and " ???????? 2"
this is the exact problem.
please tell me the problem. in mysql database i used utf8_general_collation,
i changed my php.ini file default charset "utf8"
still iam getting problem
iam entering datas directly in the database.Then I suspect you're entering them in the wrong character set. Have you checked the encoding on your terminal? If you're using Windows, I'm not sure how much you can do: DOS and cmd.exe are rather more limited.
sujith787
09-12-2007, 09:19 PM
thanks twey.
your previous answer is correct. mysql_query("SET NAMES 'utf8'");
sorry i tried wrongly.
thanks a lot for your help
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.