Locale Language problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mcasanket
Forum Newbie
Posts: 4
Joined: Tue Sep 21, 2010 11:28 pm

Locale Language problem

Post 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...! :(
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Locale Language problem

Post 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.
mcasanket
Forum Newbie
Posts: 4
Joined: Tue Sep 21, 2010 11:28 pm

Re: Locale Language problem

Post 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.... :(
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Locale Language problem

Post by josh »

Can you post code as I requested? Post phpinfo() from your machine & webserver. Do they have differing locales?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Locale Language problem

Post 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");
There are 10 types of people in this world, those who understand binary and those who don't
mcasanket
Forum Newbie
Posts: 4
Joined: Tue Sep 21, 2010 11:28 pm

Re: Locale Language problem

Post by mcasanket »

Hi Josh!
Hope you are fine and doing well.
Thank you for your replies.
I have sent you one email.


Thank you!
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Locale Language problem

Post 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.
mcasanket
Forum Newbie
Posts: 4
Joined: Tue Sep 21, 2010 11:28 pm

Re: Locale Language problem

Post by mcasanket »

Ok Josh, Thanks for deleting my mail!
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Locale Language problem

Post 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.
Post Reply