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

Wide char to UTF-8 conversion drops surrogate pairs #4094

Closed
ptc-tgamper opened this issue Jul 30, 2024 · 1 comment
Closed

Wide char to UTF-8 conversion drops surrogate pairs #4094

ptc-tgamper opened this issue Jul 30, 2024 · 1 comment

Comments

@ptc-tgamper
Copy link

ptc-tgamper commented Jul 30, 2024

The convert function,

static auto convert(Buffer& buf, basic_string_view<WChar> s,
decodes the surrogate pair,
c = (c << 10) + static_cast<uint32_t>(*p) - 0x35fdc00;
but does not write the resulting unicode character to the output buffer.

Walked into this when printing a std::filesystem::path on Windows, that uses smiley characters, such as 😀. The character is simply dropped.

@phprus
Copy link
Contributor

phprus commented Jul 30, 2024

Fix: #4095

@vitaut vitaut closed this as completed Jul 30, 2024
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

No branches or pull requests

3 participants