mursalat Posted September 24, 2008 Share Posted September 24, 2008 how do i represent non-english character from the database? i am using mysql, so say when i want to show some chinese characters "你好世界" (hello world, translated using babel fish ) from the database i get '????' signs, so how do i show it? in the database its stored perfectly (saw it using phpmyadmin.) I tried including a file that contains the chinese characters, and it comes out fine. so its gotta be some error in the process of getting data from the database. Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/ Share on other sites More sharing options...
ranjuvs Posted September 24, 2008 Share Posted September 24, 2008 which database r u using? Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-649298 Share on other sites More sharing options...
Adam Posted September 24, 2008 Share Posted September 24, 2008 What character set are you using for your HTML page? I'm not 100% but I think using: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> ... should solve the problem. That's the universal character set so should support about anything, I think? Adam Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-649308 Share on other sites More sharing options...
mursalat Posted September 28, 2008 Author Share Posted September 28, 2008 @adam - I tried it already and it didn't work, i am using mysql database. Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-652393 Share on other sites More sharing options...
mursalat Posted September 29, 2008 Author Share Posted September 29, 2008 i tried this print_r(mysql_client_encoding()); and the result was latin1, so how do i change this client encoding? Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-652746 Share on other sites More sharing options...
mursalat Posted September 30, 2008 Author Share Posted September 30, 2008 please someone - i really need help in this! Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-653866 Share on other sites More sharing options...
mursalat Posted October 3, 2008 Author Share Posted October 3, 2008 first time i see a php freak getting stuck with a with question's answer Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-656276 Share on other sites More sharing options...
xylex Posted October 4, 2008 Share Posted October 4, 2008 Make sure you set the character coding of the table you're storing the info is as UTF8 as well. CREATE TABLE....DEFAULT CHARSET = utf8; Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-656744 Share on other sites More sharing options...
mursalat Posted October 7, 2008 Author Share Posted October 7, 2008 i did that already. Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-658927 Share on other sites More sharing options...
xylex Posted October 7, 2008 Share Posted October 7, 2008 Have you tried mysql_set_charset()? Also, if you're doing any string manipulation functions with PHP after you retrieve the data, a lot of them aren't unicode compatible. Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-659158 Share on other sites More sharing options...
mursalat Posted October 11, 2008 Author Share Posted October 11, 2008 mysql_set_charset() was the solution... sorry to not answer, i did mysql_set_charset('utf8') - and it worked! Quote Link to comment https://forums.phpfreaks.com/topic/125577-solved-multilanguage-problem/#findComment-662583 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.