From: Jesse Clark Date: 2007-09-28T02:02:39+09:00 Subject: Re: xmlrpc and charset=utf-8 Sean E. Russell wrote: > On Tuesday 18 September 2007, Martin Duerst wrote: > >> Adding an accessor is definitely a very good idea. Another idea is to >> change the default to "application/xml". "application/xml" does NOT >> imply US-ASCII, but (unless it comes with a charset parameter) means >> 'look at the XML document itself' (which in case of no BOM and no >> encoding declaration means UTF-8). >> > > Another option is to have XMLRPC explicitly set the encoding to whatever the > transport says it is. Of course, this would require that XMLRPC parse the > first line of the file and make sure that the encoding isn't already > specified in the document itself, but that isn't too difficult. > > RFC 3023 states: "If an XML document -- that is, the unprocessed, source XML document -- is readable by casual users, text/xml is preferable to application/xml" and goes on to suggest that user agents which do not support text/xml can display it as text/plain. "readable by casual users" seems a little vague to me but it does seem that this paragraph implies that the choice of MIME type should be based on the structure of the xml document being transported. To me this would support the case for choosing a reasonable default ( perhaps by parsing the xml declaration, checking for a BOM, and falling back to text/xml? ) and then also provide an accessor so the user can choose to override the content-type and charset.