KBD

Keith Devens .com

Sunday, September 7, 2008 Flag waving
The three chief virtues of a programmer are: Laziness, Impatience and Hubris. – Larry Wall (Programming Perl)
← 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)
:

September 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930 



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

Recent comments XML

new⇒Trogdor tattoo!!

Oh, so cute, wowoowow....

Kathy Mead: Sep 7, 6:07am

new⇒I hate Norton Antivirus

Long long live AVG I love you!...

kevin sands: Sep 6, 7:31pm

I hate ASP.NET

CF, why pick that piece of trash?​Cold Confusion. Is it finally​really a OO...

ColdConfusion: Sep 5, 8:36pm

Maps of Iraq

This is for Linda, I will be​visiting that site some time in the​near futur...

Bob: Sep 5, 1:20pm

Girls, please don't get breast implants

Well alright I just read my above​comment and I wanted to add​this...I shou...

76.66.140.8: Sep 4, 7:31pm

Spider solitaire

I don't think the question was​necessarily if there are unbeatable​games.  ...

Jared: Sep 4, 12:44pm

Convert Pantone Colors to RGB and Hex - Color Conversion Chart

The colors on those website don't​seem to relate to the pantone data​we hav...

blah: Sep 3, 10:12am

Generated in about 0.178s.

(Used 8 db queries)

mobile phone