KBD

Keith Devens .com

Saturday, July 4, 2009 Flag waving
ALL YOUR BASE ARE BELONG TO US. – Zero Wing
← GOP.com: Who is Harry Reid?Joseph Braude at The New Republic dissects Zawahiri's recent speech →

Daily link icon Friday, February 11, 2005

Understanding charsets on the web

Sam Ruby: Meta Charset Update. Anyone who wants to understand charset issues on the web should go through most of what he links. The main thing I took away is that the charset specified in HTTP has primacy. And that makes sense. Since that makes sense, and since things seem to be working the right way most of the time, what Mark Pilgrim had to say last year doesn't seem so bad.

← GOP.com: Who is Harry Reid?Joseph Braude at The New Republic dissects Zawahiri's recent speech →

Comments XML gif

Sam Ruby (http://www.intertwingly.net/blog/) wrote:

I wish things were so clear. In fact, the W3C recommends otherwise for XML.

And when you factor in web browsers that are broken, you end up doing like http://www.google.com/ does, which is to omit the charset for HTML and put it in the meta tag.

∴ Sam Ruby | 11-Feb-2005 12:23pm est | http://www.intertwingly.net/blog/ | #6987

Keith (http://keithdevens.com/) wrote:

Well, that makes sense too. HTTP has primacy but if you don't specify the charset at the protocol level it defers to the content. Though, I didn't know that they recommend not using text/xml for XML... so, it seems we should all be using application/xml by default Smiley mad.

As for how Google does it -- that doesn't bother me too much since we're not dealing with logical inconsistencies, merely implementation bugs. But the W3C's recommendations for XML presumably apply to XHTML as well, so I suppose that implies we should all be specifying the charset only in the (X)HTML anyway?

Keith | 11-Feb-2005 1:19pm est | http://keithdevens.com/ | #6988

Anne (http://annevankesteren.nl/) wrote:

What is wrong with using application/xml by default? text/xml has issues and will be deprecated eventually.

Those W3C recommendations seem a bit weird. Not sure why they do that. I'm also not sure since when the W3C is the authority to advice people on what to do on the HTTP level.

∴ Anne | 11-Feb-2005 2:31pm est | http://annevankesteren.nl/ | #6989

Keith (http://keithdevens.com/) wrote:

Nothing's wrong with application/xml by default. It's just that it's like, "Now you're telling us?". If text/xml is no good I'd have preferred they never created it. Now I have to change my code, and what's worse is that I don't know if there are any compatibility issues between text/xml vs. application/xml. For example, will anyone have a problem if I start serving my RSS feed as application/xml instead of text/xml?[1] So, because I don't know, I'll have to check accept headers for application/xml and serve text/xml as a fallback.

Plus, if text/xml has problems and will be deprecated eventually, why isn't it deprecated now? That's what deprecated means. It doesn't make sense for anything to be in the position of "going to be deprecated". Smiley

Footnotes:
[1]: And XML-RPC? Though, XML-RPC is always POST, so maybe the issues with text/xml don't matter?

Keith | 11-Feb-2005 6:12pm est | http://keithdevens.com/ | #6991

Anne (http://annevankesteren.nl/) wrote:

There are no problems. application/xml is accepted as well. It just is that text/xml has a default charset of US-ASCII and application/xml does not. (Default is UTF-8.)

∴ Anne | 12-Feb-2005 4:48am est | http://annevankesteren.nl/ | #6996

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2009
SunMonTueWedThuFriSat
 1234
567891011
12131415161718
19202122232425
262728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 3 posts

Recent comments XML

new⇒Wizard's First Rule

> while it is cheesy to some​extent, I actually found it to be​pretty enjoy...

Keith: Jul 3, 6:33pm

I hate Norton Antivirus

I bought Norton 2009 and it is not​installing on my computer!!!
It​seems l...

o'neil: Jun 30, 11:44am

Generated in about 0.199s.

(Used 8 db queries)