Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>An ASCII codec obviously cannot decode this because it isn't ASCII. I think you will have to find out the encoding of the data and pass an unicode string to Suds. For example, if the encoding is UTF-16 pass <code>unicode(binarydata, 'utf-16')</code> to Suds.</p> <p>What you regard as a mess of badly-encoded garbage in you first example is simply what your screen displays when you let it show binary data. The characters that are displayed here depend on the character set configuration of your system.</p> <p>Your second example is Python's string representation of some binary data. A string representation contains only printable ASCII characters. The non-printable or non-ascii characters are displayed using a hexadecimal notation. This string representation just shows the bytes of your data and doesn't tell you whether the data is nicely encoded or not in some character set.</p> <p>I was not able to properly identify the encoding of your second example. The closest I found was 'utf-16-le'. But this still causes decoding errors at surrogate pairs.</p> <p>Using <code>s.decode('utf-16-le', 'replace')</code> I got a bunch of Chinese characters:</p> <pre><code>䘀䬬姘Ḽ뗼㖈ÿ鞽ÿݳ뺔豁鼞籆㐰曹䂾埓ÿ菑忊ᣠ鿀돹诡訨糍缛뇚鰧௄ÿ嚛ܙ燼㭟㱢붡辟仪〰ꋧᎾ喝嫗⧄꨿뿬쳢㑃ᚄ汉䨏좧퉊쎥钨榒촲謋以⚗퇞즵䧪巎䃀᫕ᒺ꥜ꕕ蟎᳦罨�鮉ማ᷈⻝撛妷ⲭꬎ鉱왾䲄쉘宄㋂鷲㶡崟ﱈℒꐀ喥䷚쯒걭꬧➗⋬鰧Ⴠ衯᥵�邓椾̰ᕫ녷챣컍팶㉎⇟怩ਐ詂玮괓懔ꜙ㽰� </code></pre> <p>The interesting thing is that Google translates the third character, <code>姘</code>, to <code>http</code>.</p> <p><strong>UPDATE:</strong> The following interactive Python session may clarify what I mean in my comment below:</p> <pre><code>&gt;&gt;&gt; s = '\x00F,K\xd8Y' &gt;&gt;&gt; print(s) F,K�Y &gt;&gt;&gt; u = s.decode('utf-16-le') &gt;&gt;&gt; u u'\u4600\u4b2c\u59d8' &gt;&gt;&gt; print(u) 䘀䬬姘 &gt;&gt;&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload