-
-
Notifications
You must be signed in to change notification settings - Fork 903
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
Standardize reading from IO like objects, including StringIO #1897
Conversation
related to incomplete application of fix from #1124
We don't have to figure out the encoding again. This was already figured out in the Ruby code. fixes #1888
We know data can only be a String or IO like object.
The tests are passing without it.
This commit also consolidates some of the encoding handling logic that was repeated in multiple places.
Code Climate has analyzed commit bf2c547 and detected 6 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (80% is the threshold). This pull request will bring the total coverage in the repository to 93.5%. View more on Code Climate. |
FYI, the failures in CI are reproducible on my local dev machine after running the following to change the locale:
Prior to setting those env vars,
and after:
|
The file.encoding property could have an invalid encoding name because it is not normalized, as opposed to Charset.defaultCharset which is.
@jvshahid This changeset is fabulous. Thank you for doing all this work. Merging and queueing up for v1.11.0. |
The main objective of this PR is to fix #1888, i.e. handling of StringIO when parsing HTML documents. There are other commits to refactor the JRuby code and remove any duplicate code. The two areas were we had duplicate code were:
read_memory
orread_io
.