Python3: UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' : <p>I'am trying to get running a very simple example on OSX with python 3.5.1 but I'm really stucked. Have read so many articles that deal with similar problems but I can not fix this by myself. Do you have any hints how to resolve this issue?</p>

<p>I would like to have the correct encoded latin-1 output as defined in mylist without any errors.</p>

<p><strong>My code:</strong></p>

<pre><code># coding=&lt;latin-1&gt;

mylist = [u'Glück', u'Spaß', u'Ähre',]
print(mylist)
</code></pre>

<p>The error:</p>

<pre><code>Traceback (most recent call last):
File "/Users/abc/test.py", line 4, in &lt;module&gt;
print(mylist)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 4: ordinal not in range(128)
</code></pre>

<p><strong>How I can fix the error but still get something wrong with stdout (print):</strong></p>

<pre><code>mylist = [u'Glück', u'Spaß', u'Ähre',]
    for w in mylist:
        print(w.encode("latin-1"))
</code></pre>

<p><em>What I get as output:</em></p>

<pre><code>b'Gl\xfcck'
b'Spa\xdf'
b'\xc4hre'
</code></pre>

<p>What 'locale' shows me:</p>

<pre><code>LANG="de_AT.UTF-8"
LC_COLLATE="de_AT.UTF-8"
LC_CTYPE="de_AT.UTF-8"
LC_MESSAGES="de_AT.UTF-8"
LC_MONETARY="de_AT.UTF-8"
LC_NUMERIC="de_AT.UTF-8"
LC_TIME="de_AT.UTF-8"
LC_ALL=
</code></pre>

<p>What 
-> 'python3' shows me:</p>

<pre><code>Python 3.5.1 (default, Jan 22 2016, 08:54:32) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import sys
&gt;&gt;&gt; sys.getdefaultencoding()
'utf-8'
</code></pre>
