[Fedora-suds-list] UTF-8 encoding issue in 0.3.8?

David Lanstein lanstein at yahoo.com
Wed Nov 25 22:10:31 UTC 2009


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>




More information about the suds mailing list