Skip to content
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

Try harder to get charset from meta elements #835

Merged
merged 2 commits into from Jun 10, 2017
Merged

Try harder to get charset from meta elements #835

merged 2 commits into from Jun 10, 2017

Conversation

cketti
Copy link
Contributor

@cketti cketti commented Feb 22, 2017

Current state:
When attempting to retrieve the charset only the first meta element with content type information will be looked at. No further meta elements are considered even when the first one doesn't contain a charset parameter. See DataUtilTest.secondMetaElementWithContentTypeContainsCharsetParameter().

With this fix:
All meta elements are looked at until a charset is found, i.e. the first viable one is used.

Fixes #834

When attempting to retrieve the charset only the first meta element with
content type information will be looked at. No further meta elements are
considered even when the first one doesn't contain a charset parameter.
Copy link
Owner

@jhy jhy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jhy jhy merged commit 91afa82 into jhy:master Jun 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataUtil.parseByteData charset detect issue
2 participants