On Python 2.x, encode/decode strings properly but don't use MultiLineStr.