title: What's the deal with Python 3.4, Unicode, different languages and Windows?
body: <p>Happy examples:</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  czech = u'Leoš Janáček'.encode("utf-8")
  print(czech)
  
  pl = u'Zdzisław Beksiński'.encode("utf-8")
  print(pl)
  
  jp = u'リング 山村 貞子'.encode("utf-8")
  print(jp)
  
  chinese = u'五行'.encode("utf-8")
  print(chinese)
  
  MIR = u'Машина для Инженерных Расчётов'.encode("utf-8")
  print(MIR)
  
  pt = u'Minha Língua Portuguesa: çáà'.encode("utf-8")
  print(pt)
  </code></pre>
  
  <p>Unhappy output:</p>
  
  <pre><code>b'Leo\xc5\xa1 Jan\xc3\xa1\xc4\x8dek'
  b'Zdzis\xc5\x82aw Beksi\xc5\x84ski'
  b'\xe3\x83\xaa\xe3\x83\xb3\xe3\x82\xb0 \xe5\xb1\xb1\xe6\x9d\x91 \xe8\xb2\x9e\xe5\xad\x90'
  b'\xe4\xba\x94\xe8\xa1\x8c'
  b'\xd0\x9c\xd0\xb0\xd1\x88\xd0\xb8\xd0\xbd\xd0\xb0 \xd0\xb4\xd0\xbb\xd1\x8f \xd0\x98\xd0\xbd\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd1\x85 \xd0\xa0\xd0\xb0\xd1\x81\xd1\x87\xd1\x91\xd1\x82\xd0\xbe\xd0\xb2'
  b'Minha L\xc3\xadngua Portuguesa: \xc3\xa7\xc3\xa1\xc3\xa0'
  </code></pre>
  
  <p>And if I print them like this:</p>
  
  <pre><code>jp = u'リング 山村 貞子'
  print(jp)
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Traceback (most recent call last):
    File "x.py", line 5, in &lt;module&gt;
      print(jp)
    File "C:\Python34\lib\encodings\cp850.py", line 19, in encode
      return codecs.charmap_encode(input,self.errors,encoding_map)[0]
  UnicodeEncodeError: 'charmap' codec can't encode characters in position
  0-2: character maps to &lt;undefined&gt;
  </code></pre>
  
  <p>I've also tried the following from <a href="https://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console">this question</a> (And other alternatives that involve <code>sys.stdout.encoding</code>):</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  from __future__ import print_function
  import sys
  
  def safeprint(s):
      try:
          print(s)
      except UnicodeEncodeError:
          if sys.version_info &gt;= (3,):
              print(s.encode('utf8').decode(sys.stdout.encoding))
          else:
              print(s.encode('utf8'))
  
  jp = u'リング 山村 貞子'
  safeprint(jp)
  </code></pre>
  
  <p>And things get even more cryptic:</p>
  
  <pre><code>πâ¬πâ│πé░ σ▒▒µ¥æ Φ▓₧σ¡É
  </code></pre>
  
  <p><a href="https://docs.python.org/3/howto/unicode.html" rel="noreferrer">And the docs were not very helpful</a>.</p>
  
  <p>So, what's the deal with Python 3.4, Unicode, different languages and Windows? Almost all possible examples I could find, deal with Python 2.x.</p>
  
  <p>Is there a general and cross-platform way of printing ANY Unicode character from any language in a decent and non-nasty way in Python 3.4?</p>
  
  <p>EDIT:</p>
  
  <p>I've tried typing at the terminal:</p>
  
  <pre><code>chcp 65001
  </code></pre>
  
  <p>To change the code page, <a href="https://stackoverflow.com/questions/388490/unicode-characters-in-windows-command-line-how">as proposed here</a> and in the comments, and it did not work (Including the attempt with sys.stdout.encoding)</p>