Changed the decoder to make it handle multi-byte chars properly.