Fixes for encoding issues

Changed a couple of things so that some special characters such as 'áéíóúàèìòù' are correctly displayed.
For now, tests seem to indicate that this works with both Python 2 and 3, though additional testing may be in order.

Related to #1.