With the patch applied to ENCODING_IMP, the test case gives the correct output. So it looks like making this change will fix the problem with invalid UTF-8 strings in estudio. I didn't test any other conversions - just 646 to UTF-32. Someone should write an eweasel test that converts various strings between different encodings and compares `last_converted_stream' to different values, depending on whether current platform is big endian or little endian, to see if they are correct.