Change the default encoding for automatic str to unicode conversion
Question: When doing the following concatenation:

    
    
    a = u'Hello there '
    b = 'pirate ®'
    c = a + b # This will raise UnicodeDecodeError
    

in python 2, `'pirate ®'` is automatically converted to `unicode` type through
ascii encoding. And since there is a non-ascii unicode sequence (`®`) in the
string, it will fail.

Is there a way to change this default encoding to utf8?


Answer: It is possible, although it's considered a hack. You have to reload `sys`:

    
    
    import sys
    reload(sys)
    sys.setdefaultencoding('utf-8')
    

See this blog post for some explanation of the potential issues this raises:
<http://blog.startifact.com/posts/older/changing-the-python-default-encoding-
considered-harmful.html>

It may be the only option you have, but you should be aware that it can lead
to further problems. Which is why it's not a simple and easy thing to set.

