I can suggest two ways here:
1. Fallback to the system default encoding.
2. Raise RuntimeException, e.g. :66 line is also able to raise an exception under certain circumstances.

I'd vote for 1. I will prepare a new serie of patches tomorrow.