title: Why encoding in utf-8 still results in ascii?
body: <p>As per this code:</p>
  
  <pre><code># coding=utf-8
  import sys
  import chardet
  
  print(sys.getdefaultencoding())
  
  a = 'abc'
  
  print(type(a))
  print(chardet.detect(a))
  
  b = a.decode('ascii')
  
  print(type(b))
  
  
  c = '中文'
  
  print(type(c))
  print(chardet.detect(c))
  
  
  m = b.encode('utf-8')
  print(type(m))
  print(chardet.detect(m))
  
  n = u'abc'
  
  print(type(n))
  
  x = n.encode(encoding='utf-8')
  
  print(type(x))
  print(chardet.detect(x))
  </code></pre>
  
  <p>I use <em><code>utf-8</code></em> to encode <code>n</code> but the result still show the result is <code>ascii</code>.</p>
  
  <p>So I want to know, what is relation between <em><code>utf-8</code></em>, <em><code>ascii</code></em> and <em><code>unicode</code></em>.</p>
  
  <p>i run with python2. </p>
  
  <p>===================result=================================
  <a href="https://i.stack.imgur.com/MpCRl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MpCRl.png" alt="enter image description here"></a></p>
  
  <p>=======================end result =============================</p>