UTF-8 encoding.
More...
#include <rapidjson.h>
template<typename CharType = char>
struct rapidjson::UTF8< CharType >
UTF-8 encoding.
http://en.wikipedia.org/wiki/UTF-8
- Template Parameters
-
| CharType | Type for storing 8-bit UTF-8 data. Default is char. |
◆ Ch
template<typename CharType = char>
◆ Encode()
template<typename CharType = char>
339 if (codepoint <= 0x7F)
340 *buffer++ = codepoint & 0xFF;
341 else if (codepoint <= 0x7FF) {
342 *buffer++ = 0xC0 | ((codepoint >> 6) & 0xFF);
343 *buffer++ = 0x80 | ((codepoint & 0x3F));
345 else if (codepoint <= 0xFFFF) {
346 *buffer++ = 0xE0 | ((codepoint >> 12) & 0xFF);
347 *buffer++ = 0x80 | ((codepoint >> 6) & 0x3F);
348 *buffer++ = 0x80 | (codepoint & 0x3F);
352 *buffer++ = 0xF0 | ((codepoint >> 18) & 0xFF);
353 *buffer++ = 0x80 | ((codepoint >> 12) & 0x3F);
354 *buffer++ = 0x80 | ((codepoint >> 6) & 0x3F);
355 *buffer++ = 0x80 | (codepoint & 0x3F);
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:80
References RAPIDJSON_ASSERT.
The documentation for this struct was generated from the following file: