In Jython and IronPython, str == unicode.
Jython and IronPython need encoders[bytes].
Workaround for IronPython.

See http://ironpython.codeplex.com/workitem/34532 .