yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

\_ as NBSP support

Open pavelalexeenko opened this issue 11 months ago • 1 comments

YAML::Node node = YAML::Load("{text1: \"Hello\u00A0World\", text2: \"Hello World\", text3: \"Hello\\_World\"}");

std::string text1 = node["text1"].as<std::string>();
std::string text2 = node["text2"].as<std::string>();
std::string text3 = node["text3"].as<std::string>();

These 3 texts should all be the same according to YAML standard, but they are not. Checkout Escape codes section. Backslash with underscore should be equal to NBSP http://yaml.org/refcard.html

text1 = "Hello World" text2 = "Hello World" text3 = "Hello\xa0World"

Am I doing something wrong?

pavelalexeenko avatar Feb 05 '25 13:02 pavelalexeenko