diff --git a/include/rapidjson/encodings.h b/include/rapidjson/encodings.h index 27bb6e9..c7e8e5b 100644 --- a/include/rapidjson/encodings.h +++ b/include/rapidjson/encodings.h @@ -219,12 +219,12 @@ struct UTF16 { RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2); if (codepoint <= 0xFFFF) { RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair - os.Put(static_cast(codepoint)); + os.Put(static_cast(codepoint)); } else { RAPIDJSON_ASSERT(codepoint <= 0x10FFFF); unsigned v = codepoint - 0x10000; - os.Put(static_cast((v >> 10) | 0xD800)); + os.Put(static_cast((v >> 10) | 0xD800)); os.Put((v & 0x3FF) | 0xDC00); } }