From 97bb82ebcdf8f1391b9d93b5a8d7b1dfc4e88e52 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 Oct 2021 14:15:51 -0400 Subject: Removing exceptions from core/compiler-core (#1953) * #include an absolute path didn't work - because paths were taken to always be relative. * Refactor Stream. Working on all tests. * Split out CharEncode. * Make method names lower camel. m_prefix in Writer/Reader * Tidy up around CharEncode interface. * Small improvements around encode/decode. * Better use of types. * Remove readLine from TextReader. * Remove exceptions from Stream/Text handling. * Fix some typos. * Fix tabbing. * Fix missing override. * Remove remaining exception throw/catch via using signal mechanism. * Remove exceptions that are not used anymore. * Document the Stream interface. * Remove index for decoding 'get byte' function. * Fix CharReader -> ByteReader. --- source/core/slang-string-escape-util.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/core/slang-string-escape-util.cpp') diff --git a/source/core/slang-string-escape-util.cpp b/source/core/slang-string-escape-util.cpp index ffc43a7cb..513908c4c 100644 --- a/source/core/slang-string-escape-util.cpp +++ b/source/core/slang-string-escape-util.cpp @@ -351,8 +351,7 @@ SlangResult CppStringEscapeHandler::appendUnescaped(const UnownedStringSlice& sl const Index maxUtf8EncodeCount = 6; char* chars = out.prepareForAppend(maxUtf8EncodeCount); - - int numChars = EncodeUnicodePointToUTF8(chars, int(value)); + int numChars = encodeUnicodePointToUTF8(Char32(value), chars); out.appendInPlace(chars, numChars); start = cur; @@ -812,7 +811,7 @@ SlangResult JSONStringEscapeHandler::appendUnescaped(const UnownedStringSlice& s // Need to encode in UTF8 to concat char buf[8]; - int len = EncodeUnicodePointToUTF8(buf, value); + int len = encodeUnicodePointToUTF8(Char32(value), buf); out.append(buf, buf + len); -- cgit v1.2.3