What is the difference between these codes, and what does the repr do?
<p>1.</p>

<pre><code>&gt;&gt;&gt; s = u"4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf"
&gt;&gt;&gt; print s
4-12个英文字母、数字和下划线
&gt;&gt;&gt; print repr(s)
u'4-12\u4e2a\u82f1\u6587\u5b57\u6bcd\u3001\u6570\u5b57\u548c\u4e0b\u5212\u7ebf'
</code></pre>

<p>2.</p>

<pre><code>print repr("4-12个英文字母、数字和下划线")
'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>1 and 2 are different, but the original string is the same,both are '4-12个英文字母、数字和下划线'</p>

<p>what does the repr exactly do?</p>

<p>the same value is :</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>
