285 {
287 for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
288 for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
292
293
294 {
295 unsigned decodedCodepoint = 0;
297
298 unsigned decodedCount = 0;
299 for (const char* s = encodedStr; *s; ++s)
300 if (!decode(&
state, &decodedCodepoint,
static_cast<unsigned char>(*s))) {
302 decodedCount++;
303 }
304
305 if (*encodedStr) {
307 }
308
311 std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
312 }
313
314
315 {
317 unsigned decodedCodepoint;
321 if (!result || codepoint != decodedCodepoint)
322 std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
323 }
324
325
326 {
332 }
333 }
334 }
335}
static bool Decode(InputStream &is, unsigned *codepoint)
static bool Validate(InputStream &is, OutputStream &os)