diff --git a/ext/nokogiri/xml_reader.c b/ext/nokogiri/xml_reader.c index 93d9fa7324..0895ea6a72 100644 --- a/ext/nokogiri/xml_reader.c +++ b/ext/nokogiri/xml_reader.c @@ -723,8 +723,6 @@ rb_xml_reader_encoding(VALUE rb_reader) constructor_encoding = rb_iv_get(rb_reader, "@encoding"); if (RTEST(constructor_encoding)) { return constructor_encoding; - } else { - rb_iv_set(self, "@encoding", NOKOGIRI_STR_NEW2("UTF-8")); } Data_Get_Struct(rb_reader, xmlTextReader, c_reader);