From ce1a388fa652ac2c6d69957db8da59128ffa71c7 Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Sun, 29 Mar 2015 22:58:15 -0500 Subject: [PATCH] Copied Strings from Google Code wiki --- Strings.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Strings.md diff --git a/Strings.md b/Strings.md new file mode 100644 index 0000000..5acd23c --- /dev/null +++ b/Strings.md @@ -0,0 +1,14 @@ +# Encodings and `yaml-cpp` # + +`yaml-cpp` will parse any file as specificed by the [YAML 1.2 spec](http://www.yaml.org/spec/1.2/spec.html#id2570322). Internally, it stores all strings in UTF-8, and representation is done with UTF-8. This means that in + +``` +std::string str; +node >> str; +``` + +`str` will be UTF-8. Similarly, if you're accessing a map by string key, you need to pass the key in UTF-8. If your application uses a different encoding, you need to convert to and from UTF-8 to work with `yaml-cpp`. (It's possible we'll add some small conversion functions, but for now it's restricted.) + +For convenience, Richard Weeks has kindly provided a google gadget that converts Unicode to a string literal. Just paste in the Unicode: + + \ No newline at end of file