Byte decoding issues
We read the input data in chunks with a fixed number of bytes. It is possible that a chunk ends in the middle of a multibyte character, in which case decoding it fails. Introduce a _split_decode()
function to help dealing with this.
Another commits renames "input" variable names to myinput, since "input" is also the name of a builtin function in python.