[Zope3-dev] Re: Zope 3 DAV tests on Win32...
Sidnei da Silva
sidnei@x3ng.com
Thu, 22 May 2003 11:48:16 -0300
On Thu, May 22, 2003 at 10:33:17AM -0400, Fred L. Drake, Jr. wrote:
|
| I wrote:
| > xml.dom.minidom is available in both PyXML and Python 2.2, but the
| > PyXML version has advanced to include output encoding control (the
| > 'utf-8' parameter used here).
|
| Ok, I've taken a look at this, and here's my recommended solution:
|
| - continue to serialize the XML document using toxml(), but don't pass
| an encoding; this will cause it to return a Unicode string
| - encode the resulting string to UTF-8
|
| So the conversion should look like this:
|
| body = response.toxml().encode('utf-8')
|
| This will be more flexible in the version requirements and be slightly
| more efficient computationally.
The difference is that this doesnt set the 'encoding' attribute of the
xml element. I suppose I should set it by hand.
[]'s
--
Sidnei da Silva (dreamcatcher) <sidnei@x3ng.com.br>
X3ng Web Technology <http://www.x3ng.com.br>
GNU/Linux user 257852
Debian GNU/Linux 3.0 (Sid) 2.4.18 ppc
We are not a clone.