Fix encoding errors: set them synchronously, and don't set a generic error afterward.
Fix encoding errors: set them synchronously, and don't set a generic error afterward.

btrask/Sequential,johan/Sequential,btrask/Sequential,btrask/Sequential,btrask/Sequential,johan/Sequential,johan/Sequential