473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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

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
7 6432
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
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
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
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
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
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
Merci pour les conseils!

Feb 16 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ian | last post by:
Hi, I've got an english site designed that I need to translate into Chinese. I've got the Chinese wording to work with but I can't figure out how to get it into my code. I thought I could...
4
by: Knackeback | last post by:
Hi, I wrote a XML file with GNU emacs 21.2.2 and with chinese character content encoded in UTF-8. I wrote something like: <?xml version="1.0" encoding="UTF-8"?> <test> <chinese>¼»</chinese>...
6
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http...
1
by: Antonio | last post by:
With the following page aspx I try to translate one my page from English to Chinese, using UTF8, the result Is that the Chinese characters do not come read correctly, if instead I insert directly...
1
by: Anthony Liu | last post by:
I believe that topic related to Chinese processing was discussed before. I could not dig out the info I want from the mail list archive. My Python script reads some Chinese text and then split...
8
by: Agnes | last post by:
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to...
8
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as...
4
by: zxo102 | last post by:
Hi there, I have a dictionary with values of Chinses Characters. For example, >>> dict = {} >>> dict="中国一" >>> dict="中国二" >>> dict.values()
15
by: Lorenzo Stella | last post by:
Hi all, I haven't experienced functional programming very much, but now I'm trying to learn Haskell and I've learned that: 1) in functional programming LISTS are fundmental; 2) any "cycle" in FP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.