You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"''');
voidmain(List<String> arguments) {
testYaml(r'''test: "Lorem ipsum 😅"''');
testYaml(r'''test: "Lorem ipsum \uD83D\uDE05"''');
}
voidtestYaml(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.
The text was updated successfully, but these errors were encountered:
If you need to use characters like emoji which is encoded with two UTF-16 code units, you can just access it with the uppercase escape sequence \U and enter the UTF-32 codepoint directly.
For instance, 😅 is U+1F605, so you'd write:
test: "Lorem ipsum \U0001F605"# must be in 32 bits / 8 bytes.
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.
The text was updated successfully, but these errors were encountered: