UTF-8 encoding.
More...
#include <rapidjson.h>
|
static Ch * | Encode (Ch *buffer, unsigned codepoint) |
|
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>
364 if (codepoint <= 0x7F)
365 *buffer++ = codepoint & 0xFF;
366 else if (codepoint <= 0x7FF) {
367 *buffer++ = 0xC0 | ((codepoint >> 6) & 0xFF);
368 *buffer++ = 0x80 | ((codepoint & 0x3F));
370 else if (codepoint <= 0xFFFF) {
371 *buffer++ = 0xE0 | ((codepoint >> 12) & 0xFF);
372 *buffer++ = 0x80 | ((codepoint >> 6) & 0x3F);
373 *buffer++ = 0x80 | (codepoint & 0x3F);
377 *buffer++ = 0xF0 | ((codepoint >> 18) & 0xFF);
378 *buffer++ = 0x80 | ((codepoint >> 12) & 0x3F);
379 *buffer++ = 0x80 | ((codepoint >> 6) & 0x3F);
380 *buffer++ = 0x80 | (codepoint & 0x3F);
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:105
References RAPIDJSON_ASSERT.
The documentation for this struct was generated from the following file: