title: How can I print special characters with Python 3?
body: <p>I am trying to write a simple CGI script with Python 3 that will print the string "MÅDRS" (note the Å). The following code works fine:</p>
  
  <pre><code>print("Content-type: text/html")
  print("\n")
  print("Test")
  </code></pre>
  
  <p>However, when I attempt to print "MÅDRS" instead of "Test" I receive the following error:</p>
  
  <pre><code>Traceback (most recent call last):
  File "index.cgi", line 69, in &lt;module&gt;
  File "index.cgi", line 51, in main
  File "/usr/local/lib/python3.0/io.py", line 1494, in write
      b = encoder.encode(s)
  File "/usr/local/lib/python3.0/encodings/ascii.py", line 22, in encode
      return codecs.ascii_encode(input, self.errors)[0]
  UnicodeEncodeError: 'ascii' codec can't encode character '\xc5' in position 1: ordinal not in range(128)
  </code></pre>
  
  <p>Is there a simple solution to this problem? I have been researching for several hours but can't seem to find it.</p>