Having trouble with chinese characters - viewing local html file OK but same file viewed online from server displays wrong

I don't know why the same file displays differently when viewed in any browser locally on my machine and when uploaded and viewed in the same browsers online.

I'm trying to view 2 different files.. one in traditional chinese and the other in simplified chinese (charsets big5 and gb2312).

At first I thought it was a browser thing but then I saw the same thing in other browsers.

Any ideas please?

Thanks,
D
LVL 1
DionysusAsked:
Who is Participating?
 
Computer101Commented:
PAQed with points refunded (250)

Computer101
EE Admin
0
 
Irwin SantosComputer Integration SpecialistCommented:
The server is not using the same character set as the local machine.
0
 
DionysusAuthor Commented:
Thanks for your response... that seems likely.. however..  what do I do?

The problem is that I have the 2 versions of Chinese and regular english - how can I set the server to properly dislay these?

D
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
DionysusAuthor Commented:
By the way, I tried using PHP to set the server for the page but the page doesn't even load after I add the following code:

header('Content-type: text/html; charset=big5');

?

D
0
 
DionysusAuthor Commented:
OK..the PHP was not the problem.. it was the XML coding I tried.. the PHP header function does nothing at all... same problem.. :(
0
 
DionysusAuthor Commented:
this also begs the question, why does declaring my xml encoding make the page display blank?
0
 
ZylochCommented:
You may want to try to force the server to send out the correct content-type headers for your particular file(s). If you have Apache, and .htaccess, you can include this:

<Files "chinese.html">
AddCharset big5 .html
</Files>

More information may be found at http://www.w3.org/International/questions/qa-htaccess-charset

As for why your XML encoding is forcing the page to display blank, that depends on what exactly you're doing. Can you clarify a little more? And does this affect more than one browser?
0
 
DionysusAuthor Commented:
I am hosting with someone else and do not have access to the server in that way.. but yes, the server is Unix/Apache..

However I already spoke with them and suggested AddCharset - as well as AddType.  They told me that the server is already set up to encode various languages including Chinese.

I'm now waiting to hear back from them..

The xml issue was causing a problem for my browser..  so I tried and had the same problem in Mozilla, Safari (on Mac) and Mozilla, Explorer (on PC) and each time.. nothing at all on the page.. just blank.

I've since removed it.. according to the W3C - it's low on the list of deciding factors..
0
 
ZylochCommented:
Alright. Let us know if anything new pops up with the charset question. I don't see you doing anything wrong; the PHP header() you sent looks fine. You could also use a <meta> tag directly in the <head> section, but it should amount to the same effect anyways. If it's anything, it probably is the server, though if worst comes to worst, most browsers allow the user to manually change encodings, and you can let your visitors know how to do that in the most popular browsers.

If you feel you need to address the XML problem, feel free to post more details (code, perhaps). Otherwise, you're set.
0
 
DionysusAuthor Commented:
The meta tag is there too..  from the beginning.. hasn't done anything. :(

The thing is.. when I look in my browser to see what encoding (set to Auto)...it shows correctly as "Chinese Traditional - big5" - however it doesn't display correctly.

I can only assume it's the server because nothing else makes sense.

Thanks for responding so quickly.. sometimes on here, it's painful to wait days with no response to a question.. and of couse, every question needs to be solved ASAP.. :)

Anyway.. thanks for your help.. I'll keep you posted.. hopefully sooner rather than later.

D
0
 
DionysusAuthor Commented:
One more thing..  this site is a 3 language site.. Chinese Traditional (big5), Chinese Simplified (gb2312) and English.

That's why I thought that PHP's header function would be the way to do it, in tandem with the meta tag, so that different pages could have different encoding.

Funny thing is that when I leave it at  >> header('Content-type: text/html; charset=big5'); <<  it doesn't work.. however.. when I change it to utf-8, it completely makes everything much worse off.  So I have proof that the PHP header does SOMETHING.. it's just that the big5 doesn't work as it's supposed to.

Very strange.

For the record.. I'm using XHTML, transitional in the DOCTYPE..

D
0
 
ZylochCommented:
Interesting. If you manually change your browser to display in big5, does it work?
0
 
DionysusAuthor Commented:
It is already in big5 - it auto detects it..  but I change it to something else and then back.. and it's the same.. not quite right..  full of question marks and some chinese characters (but not necessarily the right ones).

However.. as I said.. the same file on my desktop will auto-detect and CORRECTLY display.

D
0
 
ZylochCommented:
I feel useless since I don't have much else to add. It's strange that this bug appears in multiple browsers, all which seem to read and interpret your local file perfectly. If I were to guess, I would say it definitely is a server problem, although I am not sure what you can do if your host says everything is alright. You might want to try on a different (maybe free) host just to confirm whether it is a server problem or not.
0
 
DionysusAuthor Commented:
That's a good point.. I'll try that on my own hosting package.. see what happens..

I'll be back..

D :)
0
 
DionysusAuthor Commented:
Well.. bad news..

Even on my own personal hosting package..  the same thing is happening.. With and without the php header call, with and without the DOCTYPE..

However.. all that might mean is that a lot of North American hosting companies don't have many requests for serving chinese web sites.

Not sure what else to do..  it might help if I had deeper control over the server.. but I doubt that I'd be allowed.. so the only option I can think of right now is to save the text as a graphic file.. however.. that is the lamest solution available and will harm the website in terms of searchabiity.

D
0
 
DionysusAuthor Commented:
You can view the file itself on my server..

http://www.aethon.net/welcomeb.php

Try and save the file after and view it locally in your browser and see if it looks correct.

I've attached a screenshot of the correct layout at www.aethon.net/big5.png

D
0
 
ZylochCommented:
Definitely don't save the text as a graphics file. It might be possible that many of these hosts are not set up to correctly display Chinese, since it is not extremely prevalent. Of course, you could set up your own server, download Apache, and then you would have ultimate control, but aside from that and searching for better hosting companies, I don't know what else to say. Sorry.
0
 
DionysusAuthor Commented:
Hey.. could it be because I'm using fonts in the CSS? Or would encoding overrride that?

D
0
 
ZylochCommented:
Yes, I can confirm that though the encoding is correct, the text is still half gibberish in both FF2.0 and IE6. In fact, I can't even save the file correctly, since it will only save the gibberish.
0
 
ZylochCommented:
Yes, fonts are a big possibility! The encoding would not overwrite anything. Try reverting to just Arial and see how it goes.
0
 
DionysusAuthor Commented:
Nope.. makes no difference.
0
 
DionysusAuthor Commented:
:( Thought I had found something there!

Your enthusiasm and participation is helping though :)
0
 
ZylochCommented:
Me too. I think I read somewhere that only certain fonts were supported. Aha! I found it again on a Google search: http://www.hotpeachpages.net/a/characters.html
0
 
DionysusAuthor Commented:
You're right.. it saves the gibberish..   try the file as a zip

www.aethon.net/welcomeb.htm.zip

I just removed the php header call..  see if it looks like the PNG

D
0
 
ZylochCommented:
Yes, it looks completely fine in both IE and FF. I even tried changing the font, and it was unfazed.
0
 
DionysusAuthor Commented:
Well that is so damn bizarre..  I'm completely stumped..

By the way.. if you have any other french questions.. ask me.. I'm multilingual..  and live in Montreal.. and happen to be quite good with french :)
0
 
ZylochCommented:
Alright, sure thing. I'm stumped too :-(

I'll keep thinking though, and if I come up with anything, I'll let you know.
0
 
DionysusAuthor Commented:
OK.. I'll let you know what I come up with..  if nothing comes up soon, I'll throw you the points anyway.

Thanks man,
D
0
 
DionysusAuthor Commented:
Well.. the hosting company basically copped out.. saying "if the person has the correct fonts installed it's OK" and they closed the ticket.. ;) what a joke..

They ignored everything I told them including the fact that I DO have the fonts installed and only have the problem with the HTML document when viewed online..  and not when viewed locally.

So..  I told them so and now I'm waiting for a response.. in the meantime..in order to get the site working ASAP, I'm going to use images instead of text.. something I hate doing.  I'll sub in the real text later if I find a solution.

I'll wait and see what they say and then otherwise.. close this question..

Unless of course someone else might know what's going on here?

D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.