Re: characted encoding problem

Discussion in 'HTML' started by David Dorward, Jul 9, 2003.

  1. highland wrote:

    > so i always set
    > <META HTTP-EQUIV="content-type" content="text/html; charset=iso-8859-2"
    > but, browsers does not respect that, they always want to browse
    > using western iso-8859-1.


    Most webservers ignore http-equiv. Whatever http header they send out with
    the character set takes precidence.

    Check the server config.

    --
    David Dorward http://david.us-lot.org/
    Redesign in progress: http://stone.thecoreworlds.net/
    Microsoft announces IE is dead (so upgrade):
    http://minutillo.com/steve/weblog/2003/5/30/microsoft-announces-ie-is-dead
    David Dorward, Jul 9, 2003
    #1
    1. Advertising

  2. David Dorward

    DU Guest

    David Dorward wrote:

    > highland wrote:
    >
    >
    >>so i always set
    >><META HTTP-EQUIV="content-type" content="text/html; charset=iso-8859-2"
    >>but, browsers does not respect that, they always want to browse
    >>using western iso-8859-1.

    >
    >
    > Most webservers ignore http-equiv. Whatever http header they send out with
    > the character set takes precidence.
    >
    > Check the server config.
    >


    I wish I would know more about all this. Using charset and hreflang in
    links leading to an alternate translated page is no help. And now, http
    headers and content-language header are sometimes ignored by webservers,
    you say. Sometimes, I'm not sure I understand all this well... If page
    code explicitly says charset=iso-8859-2, then why the browser would
    still want to render it as iso-8859-1 or windows-1252?



    FWIW,
    Highland, hoping you're reading this, you can check for yourself the
    sent http headers here:

    http://webtools.mozilla.org/web-sniffer/

    as a bookmarklet:
    javascript:document.location.href =
    'http://webtools.mozilla.org/web-sniffer/view.cgi?url=' +
    escape(document.location.href)

    I checked the TestingPolish.htm page at geocities and, among the output,
    I got this:

    will send these HTTP Request headers:
    Accept: (snipped) text/html (etc...)
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

    I wonder what these "q=decimal value" mean. ...
    Just trying myself to better understand all this.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    DU, Jul 9, 2003
    #2
    1. Advertising

  3. DU wrote:

    > I wish I would know more about all this. Using charset and hreflang in
    > links leading to an alternate translated page is no help.


    Well - most user agents don't pay them much mind.

    > And now, http headers and content-language header are sometimes ignored by
    > webservers, you say.


    No. The headers are sent BY the server.

    The <meta> tags used to set them are generally ignored by

    (a) The browser - because it needs to know the data before it tries to parse
    the page, not mid-way thought it

    (b) The server - because it means processing all .html documents and doesn't
    work for non-HTML content (so they have other means to specify it).

    The http-equiv <meta> was ill-conceived.


    --
    David Dorward http://david.us-lot.org/
    Redesign in progress: http://stone.thecoreworlds.net/
    Microsoft announces IE is dead (so upgrade):
    http://minutillo.com/steve/weblog/2003/5/30/microsoft-announces-ie-is-dead
    David Dorward, Jul 9, 2003
    #3
  4. On Wed, 09 Jul 2003 15:30:01 -0400, DU wrote:

    > will send these HTTP Request headers:
    > Accept: (snipped) text/html (etc...)
    > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    >
    > I wonder what these "q=decimal value" mean. ...


    The "q" value specifies which is preferred. For example:

    Accept: text/html;q=1.0, text/plain;q=0.9, text/*;q=0.5, */*;q=0.1

    means "The best MIME type to send me would be text/html, but if not then
    text/plain is almost as good. Other text MIME types are OK as well, but
    anything else should only be used as a last resort."

    1.0 is the maximum. 0.0 is the minimum. If no value is specified, 1.0 is
    assumed (eg: the implied value for ISO-8859-1 in your example is 1.0).

    For more interestingness, look into the content negotiation tutorial in
    the Apache 2 manual. It shows you how Apache combines these "quality"
    settings in the HTTP header with the webmaster's own judgement of the
    quality of each MIME type and comes up with a compromise.

    --
    Toby A Inkster BSc (Hons) ARCS | mailto: | pgp:0x6A2A7D39
    aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:
    http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
    playing://(nothing)
    Toby A Inkster, Jul 9, 2003
    #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. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,799
    Jon Skeet [C# MVP]
    Jun 9, 2004
  2. Replies:
    1
    Views:
    23,315
    Real Gagnon
    Oct 8, 2004
  3. DU
    Replies:
    0
    Views:
    373
  4. DU
    Replies:
    0
    Views:
    379
  5. Replies:
    2
    Views:
    353
Loading...

Share This Page