Mixing strings with different encodings may cause #flush call to raise an error.

Suggested fix for #21