Skip to content

PugiXML incorrectly handles char8_t in C++20 #378

@ytimenkov

Description

@ytimenkov

In C++20 there is a std::u8string and char8_t to make UTF-8 type-safe.

Unfortunately when calling xml_attribute::set_value(u8"a string") for example compiler chooses set_value(bool) overload which lead to a surprise when all attrubutes became juse "true".

Which makes me thing that providing an overload which accepts bool is too wide: it can be any pointer at least. Would be nice to constrain it somehow.

I'm not sure if there is a need to have a separate handling when pugi::char_t is wchar_t or simply provide such overload when it's a char.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions