Is it possible to use Unicode character escaping (e.g. \u2009
) in YAML multiline strings?
this_escape_works: "foo\u2009bar"
this_escape_doesnt: >
foo\u2009bar
As per the YAML1.2 spec double quoted style for scalars is:
the only style capable of expressing arbitrary strings, by using “\” escape sequences. This comes at the cost of having to escape the “\” and “"” characters.
So folded scalars do not support escaping and you have to do
this_escape_works: "foo\u2009bar"
this_escape_doesnt: "foo\u2009bar\n"
Please note that contrary to @nj_'s claim the folding indicator >
(it is not an operator) doesn't do "newlines become spaces" in general and certainly not for the final line break
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With