From da53e7de783be947c38af3157e03ed6809e3571a Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 10 Oct 2015 17:37:36 -0400 Subject: [PATCH] fix error parsing json with \u --- src/cajun/reader.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cajun/reader.cpp b/src/cajun/reader.cpp index 1f6e9dfac..0a3dfb3ea 100644 --- a/src/cajun/reader.cpp +++ b/src/cajun/reader.cpp @@ -321,7 +321,13 @@ std::string Reader::MatchString(InputStream& inputStream) case 'n': string.push_back('\n'); break; case 'r': string.push_back('\r'); break; case 't': string.push_back('\t'); break; - //case 'u': string.push_back('\u'); break; // TODO: what do we do with this? + // TPT edit: eat \u0000 characters because the TPT font doesn't support them, and if we ignore it the json can't be parsed + case 'u': { + int eat = 4; + while (eat-- && inputStream.EOS() == false && inputStream.Peek() != '"') + inputStream.Get(); + break; + } default: { std::string sMessage = std::string("Unrecognized escape sequence found in string: \\") + c; throw ScanException(sMessage, inputStream.GetLocation());