what is the encoding of this string,'base64' or 'utf-8'??? ,how can i get it readable
<pre><code>print "4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf".decode('base64')#no
</code></pre>

<p>thanks</p>

<hr>

<p>and </p>

<p>if i have '4-12个英文字母、数字和下划线'</p>

<p>how can i get the string '4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf'</p>

<p>is</p>

<pre><code>print '4-12个英文字母、数字和下划线'.decode('what')#
</code></pre>

<p>i write:</p>

<pre><code>print u'4-12个英文字母、数字和下划线'.encode('unicode-escape')
</code></pre>

<p>it print </p>

<pre><code>4-12\xb8\xf6\xd3\xa2\xce\xc4\xd7\xd6\xc4\xb8\xa1\xa2\xca\xfd\xd7\xd6\xba\xcd\xcf\xc2\xbb\xae\xcf\xdf
</code></pre>

<p>not the string "<code>4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf</code></p>

<pre><code>print u'4-12个英文字母、数字和下划线'.decode('utf-8').encode('unicode-escape')
Traceback (most recent call last):
  File "&lt;input&gt;", line 1, in &lt;module&gt;
  File "encodings\utf_8.pyo", line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-27: ordinal not in range(128)
</code></pre>

<hr>

<p>no 'u' is also error:</p>

<pre><code>print '4-12个英文字母、数字和下划线'.decode('utf-8').encode('unicode-escape')
Traceback (most recent call last):
  File "&lt;input&gt;", line 1, in &lt;module&gt;
  File "encodings\utf_8.pyo", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb8 in position 4: unexpected code byte
</code></pre>

<hr>

<p>it's ok,thanks</p>

<pre><code>&gt;&gt;&gt; print '4-12个英文字母、数字和下划线'.decode('gb2312').encode('unicode-escape')
4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf
</code></pre>
