Can't we just always return Encoding::ascii8bit_encoding(state) here if 1.8 mode is enabled? that seems a lot less hacky and other encodings than ascii and binary should not happen