Files having foreign symbols

F

fulio pen

There are foreign symbols in one of my html files, so the meta charset
must be:

<meta http-equiv="content-type" content="text/html; charset="gb2312" /
But either online or off, the external css works well only when the
file is opened with the IE browser. When it opened with FF, the
external css doesn't work at all. No markup takes effect. The file
is in:

http://www.pinyinology.com/zidian3/n.html

Your help is greatly appreciated.

fulio pen
 
D

dorayme

fulio pen said:
There are foreign symbols in one of my html files, so the meta charset
must be:

<meta http-equiv="content-type" content="text/html; charset="gb2312" /

But either online or off, the external css works well only when the
file is opened with the IE browser. When it opened with FF, the
external css doesn't work at all. No markup takes effect. The file
is in:

http://www.pinyinology.com/zidian3/n.html

Your help is greatly appreciated.

fulio pen

You know that you have an inappropriate (for the doctype) " /> at
the end of your above meta line?

First thing to do is to fix up the errors in the mark up.
 
C

cwdjrxyz

You know that you have an inappropriate (for the doctype) " /> at
the end of your above meta line?

First thing to do is to fix up the errors in the mark up.

Also, in several places in the code, xhtml constructions such as <br /
or <br/> are used for this html4.01 document. Often this does no
harm, but not always. Also a space before the "/" at the end of a tag
is required for an xhtml tag that does not have a closing tag in html.
I believe this space was required because some browsers had trouble
with this xhtml construction if no space here was used. I have not
checked recent browsers to see if any still have this problem. In this
case, the solution is simple. You just replace all of the self-
contained xhtml end tags such as <br /> with the proper one for html
4.01 used in this document such as <br>. If I remember correctly, you
do not need the space in a smil document which is somewhat more modern
code than early xhtml 1.0 and which usually is supported by a special
player/viewer rather than directly by a browser.
 
J

Jukka K. Korpela

Scripsit fulio pen:
There are foreign symbols in one of my html files, so the meta charset
must be:

<meta http-equiv="content-type" content="text/html; charset="gb2312" /

No, that's quite an incorrect idea. You should specify the character
encoding that has actually been used in the document. The encoding is
apparently UTF-16, so that's what you should specify. Actually, modern
browsers can infer UTF-16, so you could really mess things up if you used a
meta tag like the above. But you were lucky since your mistakes cancel each
out: you have a misplaced quotation mark, so that the meta tag has no
effect; the content attribute has the value
"text/html; charset="
and then gb2312 is taken as another attribute, and ignored because there is
no such attribute.

(By the way, a markup validator would have told all this, though somewhat
less clearly.)

("Foreign symbols"? Referring to Chinese characters as "foreign" in a
worldwide context is odd, since they are native characters to about one
billion people.)
But either online or off, the external css works well only when the
file is opened with the IE browser. When it opened with FF, the
external css doesn't work at all. No markup takes effect.

That's because FF has more adequate error processing. Remmber the extra
quotation mark? It also implies that the last quotation mark in

<meta http-equiv="content-type" content="text/html; charset="gb2312" /

actually starts a quoted string. This means that processing of quoted
strings gets off the phase and very wild, and the <link> element is not
really processed at all.

The immediate fix would thus be either to remove the meta tag or change it
to

<meta http-equiv="content-type" content="text/html; charset=utf-16" />

More advice:
1) Drop XHTML 1.0. You're not even using it formally correctly. Stick to
HTML 4.01, consistently. Use either XHTML or HTML 4.01; don't mix them in
the same file (you now even use both syntaxes in meta tags).
2) Switch to UTF-8, which is much better supported than UTF-16, especially
in search engines. This means changing your authoring program to change the
actual encoding _and_ declaring UTF-8 encoding in an HTTP header and/or a
meta tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top