Fix XML 1.0 invalid control characters in DecodeJsonEscapedText#949
Closed
christianhelle with Copilot wants to merge 2 commits into
Closed
Fix XML 1.0 invalid control characters in DecodeJsonEscapedText#949christianhelle with Copilot wants to merge 2 commits into
christianhelle with Copilot wants to merge 2 commits into
Conversation
… as literals, strip XML 1.0 invalid chars Co-authored-by: christianhelle <710400+christianhelle@users.noreply.github.com>
|
Copilot
AI
changed the title
[WIP] Add Unicode support for XML doc comment generation
Fix XML 1.0 invalid control characters in DecodeJsonEscapedText
Mar 7, 2026
christianhelle
marked this pull request as ready for review
March 7, 2026 09:31
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #949 +/- ##
==========================================
- Coverage 93.56% 93.47% -0.10%
==========================================
Files 26 26
Lines 1632 1639 +7
==========================================
+ Hits 1527 1532 +5
+ Misses 37 36 -1
- Partials 68 71 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description:
DecodeJsonEscapedText()was decoding\band\fJSON escape sequences into backspace (U+0008) and form-feed (U+000C) control characters, both forbidden in XML 1.0. This could produce invalid XML documentation — causing compiler warnings or errors in projects with warnings-as-errors.Changes:
\b/\fhandling: Keep as literal two-character sequences instead of decoding to XML-invalid control characters.StripXmlInvalidChars(): Post-filter applied to the entire decoded result, removing any characters outside the XML 1.0 valid set (#x9 | #xA | #xD | [#x20–#xD7FF] | [#xE000–#xFFFD]). Catches invalid code points from\uXXXXsequences too.IsValidXml10Character(): Named helper extracted from the filter for readability.\b/\fliteral preservation, one verifying that\uXXXXsequences producing invalid XML code points (e.g. U+0007, U+001F) are stripped.Example OpenAPI Specifications:
Example generated Refit interface
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.