Skip to content

fix leading digit in AlwaysOnBase64NameProcessor encoded names - #895

Open
Sahana2524 wants to merge 1 commit into
FasterXML:3.xfrom
Sahana2524:alwayson-base64-name-start
Open

fix leading digit in AlwaysOnBase64NameProcessor encoded names#895
Sahana2524 wants to merge 1 commit into
FasterXML:3.xfrom
Sahana2524:alwayson-base64-name-start

Conversation

@Sahana2524

Copy link
Copy Markdown
Contributor

AlwaysOnBase64NameProcessor can emit names that start with a digit
base64url's alphabet includes digits, so any name whose first character is U+0400 or above (Cyrillic, Arabic, CJK, emoji, and so on) encodes to a leading digit, which is not a valid XML name start; Woodstox does not validate names, so the write succeeds but the output no longer parses back, which loses the round trip this always-on processor is meant to provide. I restore a valid start character by prepending a single _ when the encoding begins with one that can't start a name, and strip it back off on decode; a base64url encoding of UTF-8 bytes never begins with _ on its own, so the marker stays unambiguous, the mapping stays one-to-one, and letter-leading names go out exactly as before.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.14% 📈 +0.090%
Branches branches 68.92% 📈 +0.090%

Coverage data generated from JaCoCo test results

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