Yeah, as I suspected that doesn't test what you want to test. It basically treats the original utf-8 bytes as random other encodings, which leads to all kinds of different behavior.