Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>Out[2]: "u'\xd0\xa0\xd0\xbe\xd1\x81\xd1\x81\xd0\xb8\xd0\xb9\xd1\x81\xd0\xba\xd0\xb0\xd1\x8f \xd0\xa4\xd0\xb5\xd0\xb4\xd0\xb5\xd1\x80\xd0\xb0\xd1\x86\xd0\xb8\xd1\x8f'"</p> </blockquote> <p>If that's what you see, your terminal is set up wrong, it's treating UTF-8 input as being ISO-8859-1 (or cp1252 in the case of the Windows console, which isn't possible to set up right).</p> <p>The proper Python repr of <code>Российская Федерация</code> would be the Unicode literal:</p> <pre><code>u'\u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0430\u044f \u0424\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u044f' </code></pre> <p>Which as it happens is pretty close to the JavaScript/JSON string literal</p> <pre><code>"\u0420\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0430\u044f \u0424\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u044f" </code></pre> <p>If you want a 7-bit-safe (ASCII) representation of a Unicode string, JSON is a reasonable choice of format. Get it by using <code>json.dumps()</code> though rather than hacking the Python repr, since there are some subtle inconsistencies between the two formats.</p> <p>Other well-understood ASCII representations you could try might include URL-encoding (<code>%D0%A0%D0%BE...</code>) and XML character escapes (<code>&lt;value&gt;&amp;#x0420;&amp;#x043e;&amp;#x0441;...&lt;/value&gt;</code>).</p> <p>If you only need an arbitrary binary representation that doesn't need to be 7-bit safe, as Max mentioned, just <code>.encode('utf-8')</code>.</p>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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