-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add xchar support for write_escaped_string. #2904
Conversation
cc85396
to
474f12f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
include/fmt/format.h
Outdated
break; | ||
default: | ||
if (is_utf8()) { | ||
if (escape.cp < 0x100) { | ||
return format_to(out, FMT_STRING("\\x{:02x}"), escape.cp); | ||
return write_codepoint<2>(out, static_cast<Char>('x'), escape.cp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's pass prefix as char to have the cast in one place (write_codepoint
) instead of each call site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Vladislav Shchapov <[email protected]>
Thank you! |
Add
xchar
support forwrite_escaped_string
.