[Home] [By Thread] [By Date] [Recent Entries]

  • From: Philippe Poulard <Philippe.Poulard@s...>
  • To: Julian Reschke <julian.reschke@g...>
  • Date: Mon, 19 Feb 2007 09:38:46 +0100

Julian Reschke wrote:
> 
> The first line may be the XML declaration 
> (<http://www.w3.org/TR/REC-xml/#NT-XMLDecl>). It specifies the XML 
> version and the document's encoding.  If you don't have an XML 
> declaration, the XML processor will assume version 1.0 and may try to 
> derive the encoding from context (HTTP Content-Type header, ...) or the 
> document itself (byte order marks). See 
> <http://www.w3.org/TR/REC-xml/#NT-EncodingDecl>.
> 
> Best regards, Julian
> 

An important precision about XML media types, according to RFC3023 :

Content-type: text/xml; charset="utf-8"
<?xml version="1.0" encoding="utf-8"?>
=> you'll get utf-8

Content-type: text/xml
<?xml version="1.0" encoding="utf-8"?>
=> you'll get us-ascii !!!!!!

Content-type: application/xml; charset="utf-16"
{BOM}<?xml version="1.0" encoding="utf-16"?>
=> you'll get utf-16

Content-type: application/xml
<?xml version="1.0" encoding="encoding-known-by-your-parser"?>
=> you'll get encoding-known-by-your-parser

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member