It should be allowed to add arbitrary escape sequences in quoted strings like:
example: "emoji \uD83D\uDE05"
the weird thing is that emojis in quoted strings work, but only if they are not escaped:
testYaml(r'''test: "Lorem ipsum π
"''');
testYaml(r'''test: "Lorem ipsum \uD83D\uDE05"''');
void main(List<String> arguments) {
testYaml(r'''test: "Lorem ipsum π
"''');
testYaml(r'''test: "Lorem ipsum \uD83D\uDE05"''');
}
void testYaml(String yamlSource) {
try {
final result = loadYaml(yamlSource);
print('loaded: $result');
} catch (e) {
print('error while loading: $e');
}
}
loaded: {test: Lorem ipsum π
}
error while loading: Error on line 1, column 22: Invalid Unicode character escape code.
β·
1 β test: "Lorem ipsum \uD83D\uDE05"
β ^^^^^^
β΅
I haven't found anything in the yaml spec which would limit the character set allowed as escaped characters.
It should be allowed to add arbitrary escape sequences in quoted strings like:
the weird thing is that emojis in quoted strings work, but only if they are not escaped:
testYaml(r'''test: "Lorem ipsum π "''');
testYaml(r'''test: "Lorem ipsum \uD83D\uDE05"''');
I haven't found anything in the yaml spec which would limit the character set allowed as escaped characters.