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

\_ as NBSP support #1343

Open
pavelalexeenko opened this issue Feb 5, 2025 · 1 comment
Open

\_ as NBSP support #1343

pavelalexeenko opened this issue Feb 5, 2025 · 1 comment

Comments

@pavelalexeenko
Copy link

pavelalexeenko commented Feb 5, 2025

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 pavelalexeenko changed the title \_ as NBPS support \_ as NBSP support Feb 5, 2025
@pavelalexeenko
Copy link
Author

Fyi, rapidyaml lib produces correct result

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

1 participant