[Fedora-suds-list] UTF-8 encoding issue in 0.3.8 - fix
David Lanstein
lanstein at yahoo.com
Wed Nov 25 22:24:17 UTC 2009
trunk/suds/sax/text.py
- d[cls.base] = str(t)
+ d[cls.base] = unicode(t)
----- Original Message ----
From: David Lanstein <lanstein at yahoo.com>
To: David Lanstein <lanstein at yahoo.com>; fedora-suds-list at redhat.com
Sent: Wed, November 25, 2009 2:17:24 PM
Subject: Re: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8?
r595 is the first revision to throw the exception.
----- Original Message ----
From: David Lanstein <lanstein at yahoo.com>
To: fedora-suds-list at redhat.com
Sent: Wed, November 25, 2009 2:10:31 PM
Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8?
Hi Jeff,
My unit tests are now failing in the 0.3.8 beta, all with the same error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 2: ordinal not in range(128). I'll pull together a test case, but in the meantime, an example raw SOAP request is (note the umlauts and Chinese chars):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="urn:partner.soap.sforce.com" xmlns:ns1="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:partner.soap.sforce.com" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<tns:SessionHeader>
<tns:sessionId>xxx</tns:sessionId>
</tns:SessionHeader>
<tns:CallOptions>
<tns:client>xxx</tns:client>
<tns:defaultNamespace>xxx</tns:defaultNamespace>
</tns:CallOptions>
<tns:AssignmentRuleHeader>
<tns:assignmentRuleId xsi:nil="true"/>
<tns:useDefaultRule>true</tns:useDefaultRule>
</tns:AssignmentRuleHeader>
<tns:MruHeader>
<tns:updateMru>true</tns:updateMru>
</tns:MruHeader>
<tns:AllowFieldTruncationHeader>
<tns:allowFieldTruncation>false</tns:allowFieldTruncation>
</tns:AllowFieldTruncationHeader>
<tns:PackageVersionHeader>
<tns:packageVersions>{majorNumber = 3, namespace = SFGA, minorNumber = 0, }</tns:packageVersions>
</tns:PackageVersionHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns0:create>
<ns0:sObjects>
<ns1:type>Lead</ns1:type>
<ns1:Id xsi:nil="true"/>
<ns1:FirstName>Joë</ns1:FirstName>
<ns1:LastName>Möke</ns1:LastName>
<ns1:Company>你好公司</ns1:Company>
<ns1:Email>joe at example.com</ns1:Email>
</ns0:sObjects>
<ns0:sObjects>
<ns1:type>Lead</ns1:type>
<ns1:Id xsi:nil="true"/>
<ns1:FirstName>Böb</ns1:FirstName>
<ns1:LastName>Möke</ns1:LastName>
<ns1:Company>你好公司</ns1:Company>
<ns1:Email>bob at example.com</ns1:Email>
</ns0:sObjects>
</ns0:create>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
_______________________________________________
fedora-suds-list mailing list
fedora-suds-list at redhat.com
https://www.redhat.com/mailman/listinfo/fedora-suds-list
More information about the suds
mailing list