[Twisted-web] XMLRPC response encoding

Jean-Paul Calderone exarkun at divmod.com
Mon Oct 22 07:55:49 EDT 2007

On Mon, 22 Oct 2007 13:31:31 +0200, Daniel de la Cuesta <daniel.cuesta at iavante.es> wrote:
><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
>  <title></title>
><body bgcolor="#ffffff" text="#000000">
>We are working on a middleware with Twisted that connects to a POP3
>server and provides an XMLRPC interface (using twisted.web)) to
>interacts with third party clients.<br>
>The twisted middleware has to deal with non ASCII (UTF-8 or Latin-1)
>encodings in the subject and the body of the mail messages. I have seen
>that Twisted XMLRPC server doesn't specify the encoding of the XMLRPC
>response, for example:<br>
><pre>&lt;?xml version='1.0'?&gt;</pre>
>This issue produces an error when "expat" parses the response in the
>xmlrpc client:<br>
><pre>xml.parsers.expat.ExpatError: not well-formed (invalid token)
>There is an open ticket with a patch to deal with "Latin-1" encodings
>at the xmlrpc server:<br>
><a href="http://twistedmatrix.com/trac/ticket/1909">http://twistedmatrix.com/trac/ticket/1909</a><br>
>But it is not closed and it has been opened one year ago. <br>
>How can I solve the encoding problem in the XMLRPC server response? <br>

Help resolve #1909.  The patch attached to the ticket is at least missing
unit tests for the new functionality it provides.  If you can provide this,
then we might be able to add the feature and resolve the ticket


More information about the Twisted-web mailing list