Better handling of encoding problems

Now we set UTF-8 as the default encoding programmatically.