fix encoding of UTF8 characters (fixes #56)