Skip to content

NY: Encode surrogate \u like solc - #724

Open
xermicus wants to merge 3 commits into
mainfrom
cl/newyork-unicode-surrogate-escape
Open

xermicus wants to merge 3 commits into
mainfrom
cl/newyork-unicode-surrogate-escape

Conversation

@xermicus

@xermicus xermicus commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Closes #697
Closes #698
Closes #699
Closes #708

Plus some drive-by fixes

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
@xermicus
xermicus requested review from elle-j and jubnzv November 9, 2026 14:48
Comment thread crates/newyork/src/from_yul.rs Outdated
Comment on lines +1442 to +1449
string_literal
.unescape_bytes()
.map_err(|error| {
TranslationError::InvalidLiteral(format!("`{string}`: {error}"))
})?
.iter()
.map(|byte| format!("{byte:02x}"))
.collect()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar to my earlier comment in related PR 723, replacing the preexisting decoding logic with calling the unescape_bytes() could also be done for the yul side so that it's shared by all sites.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, I've decided to close and instead brush this PR up to address a bunch of related problems. Could you please review again?

@xermicus xermicus mentioned this pull request Nov 11, 2026
Signed-off-by: xermicus <cyrill@parity.io>
@xermicus
xermicus requested a review from elle-j November 11, 2026 10:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants