-
-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not override encoding set during initialisation #1942
Conversation
Hi, there's a CI failure for this PR that I think is related, as it's an encoding test: https://ci.nokogiri.org/teams/nokogiri-core/pipelines/nokogiri-pr/jobs/ruby-2.6-system/builds/60 I'd also like this PR to contain a test. |
@flavorjones I am not sure if to mutate encoding while passing encoding via parse_io. |
Code Climate has analyzed commit 50d7495 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 50.0% (80% is the threshold). This pull request will bring the total coverage in the repository to 46.3%. View more on Code Climate. |
The current CI failures are not due to this commit -- will take a look now. |
ok - remaining failures would be addressed by a rebase onto master, regardless this is OK to merge ... BUT I want to think about edge cases before doing so. |
My issue was that even when i set encoding to 'UTF-8' when the parser is initialised, parser.parse was calling parse_io without encoding. This meant that encoding was getting changed to 'ASCII' as per the old code. |
Just rebased onto master to get the checks green ... |
Rebased again to try to get CI green ... |
Previously, the encoding set during initialisation was set to ASCII when parsing
I've rebased this again onto current |
LGTM! Merging. Thank you for your patience!!! |
I've credited you in the changelog in 243eab5. This will be in v1.14.0. |
encoding set during initialisation of sax parser gets replaced to ASCII when parsing.
Fix: check if encoding has already been set.