Fix the decoding of inputs from UTF-8