Page 1 of 1

Locale Language problem

Posted: Tue Sep 21, 2010 11:47 pm
by mcasanket
Hello guys...
I have just joined this network.
I am developing one online examination application.
In this user can give exam in any language, like English, Hindi, Gujarati, or any other language.
For that I have created MySQL table with UTF -8 character code.
It saves and work fine in my local machine.
I mean, It shows question other than English on my browser on my local machine.
but When I run it on my server (not on local), it shows ???? on language other then English.
I have checked in DB table, the data is saved properly.


Please help me out...! :(

Re: Locale Language problem

Posted: Wed Sep 22, 2010 4:41 am
by josh
"it shows" - what is it? There are things that can come into play, the character encoding specified in the HTML's doctype, the collation of the database engine/queries, the htmlentities() method character encoding parameter, etc...

Lets get some more details and get some code posted please.

Re: Locale Language problem

Posted: Wed Sep 22, 2010 5:45 am
by mcasanket
Hi Josh

Thanks for your reply!
I have data other than English language in my DB Table local machine.
This same DB script I have executed on my server (With Insert Query). Now the DB on Server is also having the same Data.

Now when I run my program on my local PC then it works fine. It shows me other languages.
The same files are on server to. But when I run it through server URL, it does not display the Characters other than English instead it shows ????.

I have set the UTF-8 in my html file too.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>[b]<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />[/b]<title>Online Examinaton</title><script language="JavaScript" src="../javascripts/jquery.min.js"></script><script language="JavaScript" src="../javascripts/jquery.countdown.js"></script>

Also the DB table is having UTF - 8 encoding both local and remote DB.

Plz help me.... :(

Re: Locale Language problem

Posted: Wed Sep 22, 2010 8:35 pm
by josh
Can you post code as I requested? Post phpinfo() from your machine & webserver. Do they have differing locales?

Re: Locale Language problem

Posted: Thu Sep 23, 2010 3:34 am
by VladSun
Probably Apache is configured to automatically send an encoding header (thus the META specified encoding is ignored by the browser). Try reconfigure it by setting it to UTF-8:
[text]AddDefaultCharset UTF-8[/text]
or send your own header by using the PHP header function:

Code: Select all

header("Content-type: text/html; encoding=utf-8");

Re: Locale Language problem

Posted: Tue Sep 28, 2010 11:10 pm
by mcasanket
Hi Josh!
Hope you are fine and doing well.
Thank you for your replies.
I have sent you one email.


Thank you!

Re: Locale Language problem

Posted: Wed Sep 29, 2010 8:23 am
by josh
mcasanket wrote: I have sent you one email.
If you want help post a reply to the thread. I deleted your email. Thanks.

Re: Locale Language problem

Posted: Thu Sep 30, 2010 11:52 am
by mcasanket
Ok Josh, Thanks for deleting my mail!

Re: Locale Language problem

Posted: Fri Oct 01, 2010 3:55 am
by josh
If you want help I'm glad to help in the thread. I'm not doing this to help 1 person, I'm doing it to help everyone. Maybe next time you'll ask in the thread knowing that most people don't take kindly to the email requests. Outside of these forums you're a client of mine and would have to pay $100 an hour. In these forums, all help is free

You still have not posted a phpinfo() as I requested.