title: change file from gbk into utf-8 and display it in console
body: <p>My system is :python3.3+win7.<br>
  The file <code>c:\\test_before</code> is encode in gbk.you can download it and 
  save it as <code>c:\\test_before</code> from here to test.<br>
  <a href="http://pan.baidu.com/s/1i3DSuKd" rel="nofollow noreferrer">http://pan.baidu.com/s/1i3DSuKd</a><br>
  I can get every line output when i set <code>chcp 936</code> .</p>
  
  <pre><code>cname="c:\\test_before"
  dat=open(cname,"r")
  for line in dat.readlines():
      print(line)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/hf6r0.jpg" alt="enter image description here"></p>
  
  <p>Now ,i change the file into utf-8  with python.</p>
  
  <pre><code>cname="c:\\test_before"
  dat=open(cname,"rb")
  new=open("c:\\test_utf-8","wb")
  for line in dat.readlines():
      line=line.decode("gbk").encode("utf-8")
      new.write(line)
  
  new.close()
  </code></pre>
  
  <p>when i set <code>chcp 65001</code>,and run it </p>
  
  <pre><code>new=open("c:\\test_utf-8","r")
  for line in new.readlines():
      print(line)
  </code></pre>
  
  <p>why i got wrong output?<br>
  UnicodeDecodeError: 'gbk' codec can't decode byte 0xa5 in position 370: illegal
  multibyte sequence.</p>