Quote:
Originally Posted by chaley
I have never encountered code that messes so extensively with encodings like this plugin.
|
At the risk of me trying to "teach Granny how to suck eggs"

...
When I was migrating my own plugins to python3 I found these 2 items from polyglot.builtins very useful: as_unicode, as_bytes
After I'd finished I don't think I had any .encode(...) or .decode(...) code left to go wrong. However, (full disclosure) I only ever use calibre's current container class to do everything related to epub-wrangling, so it's quite likely Kovid has already catered for everything that's likely to go wrong encoding-wise.