No encoding set for XML-RPC responses
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Unassigned |
Bug Description
The XML returned by Zope as a response to an XML-RPC request contains no "encoding=" attribute to the <?xml?> header ...
This means that when there is high-bit latin 1 characters, such as accents, clients die (Including when using xmlrpclib as a client).
The problem is in lib/python/
The calls to xmlrpclib.dumps() do not include the "encoding=" parameter.
Also because this is a function and not a method of a class, I can't seem to be able to easily monkey patch it :(
The simple solution would be to hardcode the most common charset in there ( i.e. encoding=
A better way would be to use the information provided by the locale module. Something like:
encoding=
Would do ...
Admitedly however I'm not familiar with internal Zope internationaliz
XMLRPC requests are sent as "text/xml", which means the XML document is us-ascii, unless stated otherwise in the Content-Type HTTP-Header (see RFC3023 for details).
The XML declaration in the document does not declare the encoding. Maybe it's easier to encode the XML stream in us-ascii than to figure out the correct encoding?