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

Fix a problem that parse exception message can't be generated for invalid encoding XML #123

Merged
merged 2 commits into from
May 3, 2024

Conversation

naitoh
Copy link
Contributor

@naitoh naitoh commented May 3, 2024

Why?

If the XML tag contains Unicode characters and an error is occurred for the tag, an incompatible encoding error is raised. Because our parse exception message parts have an UTF-8 part (that includes the target tag information) and an ASCII-8BIT part (that includes error context input).

Fix GH-29

…etrieved if the error content contained Unicode characters.

## Why?
If the xml tag contains Unicode characters when the error occurs, an `Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT` exception is raised, ParseException error message cannot be retrieved.

See: ruby#29
@kou kou changed the title Fixed a problem in which ParseException error messages could not be retrieved if the error content contained Unicode characters. Fix a problem that parse exception message can't be generated for invalid encoding XML May 3, 2024
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

Thanks!

test/parse/test_element.rb Outdated Show resolved Hide resolved
@kou kou merged commit d78118d into ruby:master May 3, 2024
14 of 16 checks passed
@naitoh naitoh deleted the fix_ParseException_with_utf8_character branch May 3, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

ParseException could not get message when xml with invalid characters
2 participants