QSN: A Familiar String Interchange Format (2020)
oilshell.org
oilshell.org
That's not UTF-8, that's Unicode. The equivalent UTF-8 is '\xCE\xBC'. Is that what it's supposed to expand to?
All 3 encodings are valid -- literal UTF-8 bytes, hex escapes for bytes, or unicode escape.
'\n' # QSN string
$'\n' # emphasize that this is a QSN string, not something else
# note that $'' comes from shell, but isn't literally shell
It feels like the $ is too annoying to require everywhere.- But we don't want to use "" because it can be confused for JSON. - And '' means something different in Python, coreutils output, shell, JavaScript, etc.
So there aren't many other options. $'' can be for cases where it's possible the string will be confused with some other format.
(It's also true that QSN isn't identical to shell strings, there is a subset property)