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/%22%3E SOAP-ENV:Header tns:SessionHeader tns:sessionIdxxx</tns:sessionId> </tns:SessionHeader> tns:CallOptions tns:clientxxx</tns:client> tns:defaultNamespacexxx</tns:defaultNamespace> </tns:CallOptions> tns:AssignmentRuleHeader <tns:assignmentRuleId xsi:nil="true"/> tns:useDefaultRuletrue</tns:useDefaultRule> </tns:AssignmentRuleHeader> tns:MruHeader tns:updateMrutrue</tns:updateMru> </tns:MruHeader> tns:AllowFieldTruncationHeader tns:allowFieldTruncationfalse</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:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameJoë</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailjoe@example.com</ns1:Email> </ns0:sObjects> ns0:sObjects ns1:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameBöb</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailbob@example.com</ns1:Email> </ns0:sObjects> </ns0:create> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
r595 is the first revision to throw the exception.
----- Original Message ---- From: David Lanstein lanstein@yahoo.com To: fedora-suds-list@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/%22%3E SOAP-ENV:Header tns:SessionHeader tns:sessionIdxxx</tns:sessionId> </tns:SessionHeader> tns:CallOptions tns:clientxxx</tns:client> tns:defaultNamespacexxx</tns:defaultNamespace> </tns:CallOptions> tns:AssignmentRuleHeader <tns:assignmentRuleId xsi:nil="true"/> tns:useDefaultRuletrue</tns:useDefaultRule> </tns:AssignmentRuleHeader> tns:MruHeader tns:updateMrutrue</tns:updateMru> </tns:MruHeader> tns:AllowFieldTruncationHeader tns:allowFieldTruncationfalse</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:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameJoë</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailjoe@example.com</ns1:Email> </ns0:sObjects> ns0:sObjects ns1:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameBöb</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailbob@example.com</ns1:Email> </ns0:sObjects> </ns0:create> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
_______________________________________________ fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
trunk/suds/sax/text.py
- d[cls.base] = str(t) + d[cls.base] = unicode(t)
----- Original Message ---- From: David Lanstein lanstein@yahoo.com To: David Lanstein lanstein@yahoo.com; fedora-suds-list@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@yahoo.com To: fedora-suds-list@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/%22%3E SOAP-ENV:Header tns:SessionHeader tns:sessionIdxxx</tns:sessionId> </tns:SessionHeader> tns:CallOptions tns:clientxxx</tns:client> tns:defaultNamespacexxx</tns:defaultNamespace> </tns:CallOptions> tns:AssignmentRuleHeader <tns:assignmentRuleId xsi:nil="true"/> tns:useDefaultRuletrue</tns:useDefaultRule> </tns:AssignmentRuleHeader> tns:MruHeader tns:updateMrutrue</tns:updateMru> </tns:MruHeader> tns:AllowFieldTruncationHeader tns:allowFieldTruncationfalse</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:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameJoë</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailjoe@example.com</ns1:Email> </ns0:sObjects> ns0:sObjects ns1:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameBöb</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailbob@example.com</ns1:Email> </ns0:sObjects> </ns0:create> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
_______________________________________________ fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
Should have noted, line 121 in head @608.
David Lanstein Author, Salesforce Python Toolkit (http://code.google.com/p/salesforce-python-toolkit/) - built on Suds!
----- Original Message ---- From: David Lanstein lanstein@yahoo.com To: David Lanstein lanstein@yahoo.com; fedora-suds-list@redhat.com Sent: Wed, November 25, 2009 2:24:17 PM Subject: Re: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8 - fix
trunk/suds/sax/text.py
- d[cls.base] = str(t) + d[cls.base] = unicode(t)
----- Original Message ---- From: David Lanstein lanstein@yahoo.com To: David Lanstein lanstein@yahoo.com; fedora-suds-list@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@yahoo.com To: fedora-suds-list@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/%22%3E SOAP-ENV:Header tns:SessionHeader tns:sessionIdxxx</tns:sessionId> </tns:SessionHeader> tns:CallOptions tns:clientxxx</tns:client> tns:defaultNamespacexxx</tns:defaultNamespace> </tns:CallOptions> tns:AssignmentRuleHeader <tns:assignmentRuleId xsi:nil="true"/> tns:useDefaultRuletrue</tns:useDefaultRule> </tns:AssignmentRuleHeader> tns:MruHeader tns:updateMrutrue</tns:updateMru> </tns:MruHeader> tns:AllowFieldTruncationHeader tns:allowFieldTruncationfalse</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:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameJoë</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailjoe@example.com</ns1:Email> </ns0:sObjects> ns0:sObjects ns1:typeLead</ns1:type> <ns1:Id xsi:nil="true"/> ns1:FirstNameBöb</ns1:FirstName> ns1:LastNameMöke</ns1:LastName> ns1:Company你好公司</ns1:Company> ns1:Emailbob@example.com</ns1:Email> </ns0:sObjects> </ns0:create> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
_______________________________________________ fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list