Hi, I've reviewed your code and it seems you don't take precautions against multi-byte characters being split around chunk boundaries, i.e. at the start/end of every chunk. They'll instead be filtered as invalid, which will result in a character being dropped from the stream from time to time.
Let me know if I'm reading this wrong.