Note that there are some explanatory texts on larger screens.

plurals
  1. POpython - decode unicode string
    primarykey
    data
    text
    <p>I have a unicode string like this</p> <pre><code>mm = u'A\xe2\x80\x8ct\xe2\x80\x8ch\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8cl\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8ce\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8ct\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8ci\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8cc\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c Bilbao (n)\tC\xe2\x80\x8cD\xe2\x80\x8c \xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8cM\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8ci\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8cr\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8ca\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8cn\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8c\xe2\x80\x8cdes' </code></pre> <p>I want to print it out to something like <code>A‌t‌h‌‌‌‌‌‌l‌‌‌e‌‌‌‌t‌‌‌‌‌‌‌i‌‌‌‌‌c‌‌‌‌‌‌‌‌‌‌ Bilbao (n)</code> but don't know how? I've try <code>unicode(mm.encode("utf-8"), 'string-escape')</code>, but it does not work in this case.</p> <p><strong>Edit</strong>: @Ignacio Vazquez-Abrams is right, and there are some problem with PyCharm console, it display unicode string like <img src="https://i.stack.imgur.com/O7kIn.png" alt="enter image description here"></p>
    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.
 

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