Re: UTF-16 and MIME text/*

At 00:03 01/06/09 +0200, Chris Lilley wrote:

>"McDonald, Ira" wrote:

> >  XML which is encoded in UTF-8 is
> > perfectly safe to serve as "text/xml" and SHOULD be.
>
>XML which is encoded in UTF-8 and XML which is encoded in UTF-16 can
>both omit the encoding declaration. The server will have a hard time
>telling them apart.

No, it won't really have that a hard time. It just has to look at the
first two bytes of the file. But most servers don't suppor such a
thing very well these days, so in some sense, you are right.


>In addition, since both UTF-8 and UTF-16 are
>required to be supported, software might well convert between these two
>encodings based on, for example, whichever gives the smaller file size.

They of course can do that. But it's not very frequently done, as far
as I know. It's probably much easier for a server to always serve
things in the same encoding.


Regards,  Martin.

Received on Sunday, 10 June 2001 02:35:43 UTC