Skip to content

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

@ptc-tgamper

Description

@ptc-tgamper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions