By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,630 Members | 1,010 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,630 IT Pros & Developers. It's quick & easy.

Chinese Characters in html (coding on a Mac OS X)

P: n/a
Greetings,

I am presently trying to display chinese characters on a webpage
(HTML). I have tried changing the charset to big5, UTF-8 to no avail.

Word documents display correctly, as does Safari, on the Mac being
used.

What gives? Here is code used... are there conflicting items (xml tag
specifies iso - removed it but still didn't work)?

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=Big-5">

Any help much appreciated,
kapdan01

Feb 14 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
ka******@gmail.com wrote:
I am presently trying to display chinese characters on a webpage
(HTML). I have tried changing the charset to big5, UTF-8 to no avail.
Trying different encoding declarations ("charsets") at random is
pointless, or worse. Sometimes you get a result that seems to work (but
really doesn't). Please post a sample URL or two. Also please explain
how you produced the content. How was the HTML document _created_?
What gives? Here is code used...
We need URLs.
are there conflicting items (xml tag
specifies iso - removed it but still didn't work)?
Of course there is a conflict between constructs that contain
contradictory information about the encoding:
<?xml version="1.0" encoding="iso-8859-1"?> - - <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=Big-5">


But since you haven't specified the URL, we cannot know whether the HTTP
headers contain yet another information about encoding, trumping both of
the above. Besides, we don't know what the actual encoding of the data is.
Feb 14 '06 #2

P: n/a
On 13 Feb 2006 ka******@gmail.com wrote:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=Big-5">


This is a mess! "ISO-8859-1" is different from "Big-5";
and when you serve as "text/html", you shouldn't use XML (XHTML).
XHTML *Transitional* is nonsense anyway.

So make up your mind:
First, choose your document format. I suggest you stick with HTML 4.01
Strict (*not* Transitional).
Second, choose an encoding (charset). I suggest UTF-8.

--
All free men, wherever they may live, are citizens of Denmark.
And therefore, as a free man, I take pride in the words "Jeg er dansker!"

Feb 14 '06 #3

P: n/a
ka******@gmail.com wrote :
Greetings,

I am presently trying to display chinese characters on a webpage
(HTML). I have tried changing the charset to big5, UTF-8 to no avail.

Word documents display correctly, as does Safari, on the Mac being
used.

What gives? Here is code used... are there conflicting items (xml tag
specifies iso - removed it but still didn't work)?

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=Big-5">

Any help much appreciated,
kapdan01


First, I suggest you switch to HTML 4.01 strict just like A. Prilop
suggested. There is currently very little reason to choose XHTML 1.0
transitional. Your webpage will gain much more benefits with HTML 4.01
strict.

Recommended DTDs to use in your Web document.
http://www.w3.org/QA/2002/04/valid-dtd-list.html

Second, when you save your document in MS-Word, save it with the proper
encoding:

File/Save as.../Tools/Web options.../Encoding tab/Traditional Chinese
(Big 5)

Do the above if you're editing the documnet with MS-Word.

Third,
You will greatly simplify your tasks if you edit your document with Nvu
1.0 which is available in several languages and in which you can choose
the character encoding before or while you're editing your webpage.

http://www.nvu.com/

Fourth,
when you're having problems with a webpage, there is very little
readers/people in web programming newsgroups can do if they do not have
an URL to visit, to examine, from which they can/could examine the
source code.

Gérard
--
remove blah to email me
Feb 14 '06 #4

P: n/a
Greetings,

Thanks for everyone's honest & straight to the point input. I have
cleaned up the discrepancies and absurdities and it is now working.

Here is a URL: http://www.taichiclub.com/english/test.htm

If I may be so bold as to ask another question, does this mean that I
can include chinese characters in the keywords so that Chinese search
engines can index the site? or does this belong in another group?

Thanks again for your replies,
kapdan01

Feb 15 '06 #5

P: n/a
On 14 Feb 2006 ka******@gmail.com wrote:
Here is a URL: http://www.taichiclub.com/english/test.htm
| Server: Apache
| Content-Type: text/html

You should specify the encoding (charset) in the HTTP header,
not just in a META element.
http://www.w3.org/International/O-HTTP-charset.html
Otherwise you run into trouble when your server software is upgraded
to Apache 2. By default, Apache 2 sends "charset=ISO-8859-1".
If I may be so bold as to ask another question, does this mean that I
can include chinese characters in the keywords
Yes.
so that Chinese search engines can index the site?
I don't know nothing about Chinese search engines - but the usual
suspects (Google, AltaVista, etc.) ignore <META keywords> altogether.
or does this belong in another group?


<news:alt.internet.search-engines>

--
All free men, wherever they may live, are citizens of Denmark.
And therefore, as a free man, I take pride in the words "Jeg er dansker!"

Feb 15 '06 #6

P: n/a
ka******@gmail.com wrote :
Greetings,

Thanks for everyone's honest & straight to the point input. I have
cleaned up the discrepancies and absurdities and it is now working.

Here is a URL: http://www.taichiclub.com/english/test.htm

If I may be so bold as to ask another question, does this mean that I
can include chinese characters in the keywords so that Chinese search
engines can index the site? or does this belong in another group?

Thanks again for your replies,
kapdan01


Here's another reason as to why post an URL. People might be closer than
you think. I live in Montreal and I have created webpages in Chinese:

http://www.gtalbot.org/DHTMLSection/...ationPage.html

http://www.gtalbot.org/DHTMLSection/

I checked your webpages and I see several other problems the webpages have:
- too many .pdf links; pdf should be for printing 99% of the time
- too many <p>&nbsp;</p> which is basically the same as empty <p>
- table design
- too deeply nested block-level elements:
e.g.
</div>
<!-- #EndLibraryItem --><br />
<br />
</div>
</div>
</div>
</div>
</div>

</div>
</body>

which means that there are 8 levels deep of nested divs.
- many target="_blank" links and none of them are identified as opening
new windows
- the usual problems with DreamWeaver editing
- etc.

Gérard
--
remove blah to email me
Feb 15 '06 #7

P: n/a
Merci pour les conseils!

Feb 16 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.