Files having foreign symbols

Discussion in 'HTML' started by fulio pen, May 26, 2007.

  1. fulio pen

    fulio pen Guest

    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
    fulio pen, May 26, 2007
    #1
    1. Advertising

  2. fulio pen

    dorayme Guest

    In article
    <>,
    fulio pen <> wrote:

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

    --
    dorayme
    dorayme, May 26, 2007
    #2
    1. Advertising

  3. fulio pen

    cwdjrxyz Guest

    On May 26, 5:34 pm, dorayme <> wrote:
    > In article
    > <>,
    > fulio pen <> wrote:
    >
    >
    >
    > > 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.
    >
    > --
    > dorayme


    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.
    cwdjrxyz, May 27, 2007
    #3
  4. 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.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, May 27, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. priya
    Replies:
    0
    Views:
    512
    priya
    Sep 27, 2005
  2. H5N1
    Replies:
    0
    Views:
    429
  3. ernesto

    Export symbols from .a files

    ernesto, Jul 5, 2005, in forum: C++
    Replies:
    1
    Views:
    333
    Victor Bazarov
    Jul 5, 2005
  4. Replies:
    3
    Views:
    1,431
    Rolf Magnus
    Jan 18, 2009
  5. joe
    Replies:
    0
    Views:
    100
Loading...

Share This Page