Skip to content

Commit 25af39d

Browse files
committed
Visual Studio 2013 does not support UTF-8 string literals.
1 parent 636ff5e commit 25af39d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Release/src/json/json_parsing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class JSON_StreamParser<char> : public JSON_Parser
243243
}
244244

245245
private:
246-
typename std::streambuf* m_streambuf;
246+
std::streambuf* m_streambuf;
247247
};
248248

249249
#if !defined(_LIBCPP_VERSION)
@@ -309,7 +309,7 @@ class JSON_StreamParser<utf16char> : public JSON_Parser
309309
if (low_ch == std::char_traits<utf16char>::eof())
310310
{
311311
// Low surrogate is not present. Replace dangling surrogate with "REPLACEMENT CHARACTER"
312-
m_utf8_buffer = u8"\uFFFD";
312+
m_utf8_buffer = "\xEF\xBF\xBD";
313313
return;
314314
}
315315
u16_str.push_back(static_cast<utf16char>(low_ch));
@@ -321,14 +321,14 @@ class JSON_StreamParser<utf16char> : public JSON_Parser
321321
catch (...)
322322
{
323323
// Conversion failed. Replace the character with the Unicode "REPLACEMENT CHARACTER" https://en.wikipedia.org/wiki/Specials_Unicode_block
324-
m_utf8_buffer = u8"\uFFFD";
324+
m_utf8_buffer = "\xEF\xBF\xBD";
325325
}
326326
std::reverse(m_utf8_buffer.begin(), m_utf8_buffer.end());
327327

328328
assert(m_utf8_buffer.size() > 0 || m_eof);
329329
}
330330

331-
typename std::basic_streambuf<utf16char, std::char_traits<utf16char>>* m_streambuf;
331+
std::basic_streambuf<utf16char, std::char_traits<utf16char>>* m_streambuf;
332332
bool m_eof = false;
333333

334334
// The string of utf8 code units are buffered in reverse order

0 commit comments

Comments
 (0)