> In fact, we already have such a codec. The utf-16 decoder looks at the > first two bytes and then decides to forward the rest to either a > utf-16-be or a utf-16-le decoder. That's different. UTF-16 is a proper encoding that is just specified to use the BOM. "xml-auto-detection" is not an encoding. Regards, Martin