Skip to content

Commit

Permalink
Do not use a default encoding when parsing XML documents.
Browse files Browse the repository at this point in the history
This change fixes the tests in #2080, but introduces more errors.  The errors
are mostly unexpected null encoding when parsing an HTML document.
  • Loading branch information
jvshahid committed Sep 15, 2020
1 parent 386ebcb commit bd8ab90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/java/nokogiri/internals/XmlDomParserContext.java
Expand Up @@ -93,7 +93,7 @@ public XmlDomParserContext(Ruby runtime, IRubyObject options) {
public XmlDomParserContext(Ruby runtime, IRubyObject encoding, IRubyObject options) {
super(runtime);
this.options = new ParserContext.Options(RubyFixnum.fix2long(options));
java_encoding = NokogiriHelpers.getValidEncoding(encoding);
java_encoding = NokogiriHelpers.getValidEncodingOrNull(encoding);
ruby_encoding = encoding;
initErrorHandler();
initParser(runtime);
Expand Down

0 comments on commit bd8ab90

Please sign in to comment.