fix for encoding problems

had to add those three lines in order to make it work on my machine. There seems to be another solution which involves setting an environment variable, but this way seems to be more stable.