mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add unicode escapes support
This commit is contained in:
parent
8dac3ffdac
commit
65f9caec87
2 changed files with 18 additions and 1 deletions
|
|
@ -360,6 +360,13 @@ std::string BasicParser::parseString(char quote, bool closeRequired) {
|
|||
ss << (char)parseSimpleInt(8);
|
||||
continue;
|
||||
}
|
||||
if (c == 'u') {
|
||||
int codepoint = parseSimpleInt(16);
|
||||
ubyte bytes[4];
|
||||
int size = util::encode_utf8(codepoint, bytes);
|
||||
ss.write(reinterpret_cast<char*>(bytes), size);
|
||||
continue;
|
||||
}
|
||||
switch (c) {
|
||||
case 'n': ss << '\n'; break;
|
||||
case 'r': ss << '\r'; break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue