337 {
340 for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
341 for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
345
346
347 if (codepoint != 0)
348 {
349
352
353
354 unsigned decodedCodepoint = 0;
358 if (!decode(&
state, &decodedCodepoint,
static_cast<unsigned char>(*
s)))
359 break;
360 }
361
362 if (codepoint <= 0xFFFF)
364 else {
365
366 *
p++ =
static_cast<UTF16<>::Ch>(0xD7C0 + (decodedCodepoint >> 10));
367 *
p++ =
static_cast<UTF16<>::Ch>(0xDC00 + (decodedCodepoint & 0x3FF));
368 }
370
372 }
373
374
375 {
377 unsigned decodedCodepoint;
381 if (!result || codepoint != decodedCodepoint)
382 std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
383 }
384
385
386 {
392 }
393 }
394 }
395}
static bool Decode(InputStream &is, unsigned *codepoint)
static bool Validate(InputStream &is, OutputStream &os)
static void Encode(OutputStream &os, unsigned codepoint)