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

Large entity codes now supplied as decoded int instead of overflowed char #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gr81ape
Copy link

@gr81ape gr81ape commented Feb 26, 2020

I've encountered a bug where some characters such as U+1F602 will overflow when cast from an int (128569) to a char type. In the case of U+1F602, this will cause the returned character to be U+F602 instead.

This PR adds a check to see if the int value of the _nextCharacter char matches _nextCharacterCode, which will be false if an overflow occurs during the cast on line 369 (HtmlLexicalAnalyzer.cs). If so, the _nextCharacterCode is used with HttpUtility.HtmlDecode to convert the HTML representation the character (using the character code) into the correct character.

@gr81ape gr81ape changed the title Long entity codes now supplied as decoded int instead of overflowed char Large entity codes now supplied as decoded int instead of overflowed char Feb 26, 2020
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.

1 participant