SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The impact of a charset declaration?

    I'm trying to figure out exactly what the charset declaration does. Do browsers actually read the charset and switch to the one the page uses or do they only allow manual selection? If you look at the following page, it has non-ascii characters. It is written in utf8 and sure enough, if I select utf8 in Firefox, they display correctly. But by default they don't, Firefox uses iso8859-1.

    http://gridportal.dynalias.org/

    So the browser doesn't pay attention to the charset. Should it? I realize the page isn't correct html, it wouldn't validate if you tried, does that have something to do with it? Anything you could tell me about this would be helpful.

  2. #2
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For HTML, you must always specify what charset you use. You should do that with the Content-Type HTTP header. If you can't do that, you can specify it with a META element that goes first in the HEAD (which is done in the example you gave).

    My copy of Firefox gets the charset for that document just fine, as does IE, Opera and Lynx.
    Simon Pieters

  3. #3
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oddly enough, it seems to work now, while it failed to work up to this point. I did try Opera before and it did work.

  4. #4
    SitePoint Evangelist Maujor's Avatar
    Join Date
    Mar 2005
    Location
    Rio de Janeiro - Brazil - South America
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here a great tutorial at W3C on this subjet:
    http://www.w3.org/International/tuto...har-enc/en/all
    Mauricio Samy Silva
    http://www.maujor.com/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •