MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / CodePoint_from_UTF8

Function CodePoint_from_UTF8

xmpsdk/src/UnicodeConversions.cpp:566–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564// =================================================================================================
565
566void CodePoint_from_UTF8 ( const UTF8Unit * utf8In, const size_t utf8Len, UTF32Unit * cpOut, size_t * utf8Read )
567{
568 UTF8Unit inUnit; // ! Don't read until we know there is input.
569 size_t unitCount = 0;
570
571 UC_Assert ( (utf8In != 0) && (cpOut != 0) && (utf8Read != 0) );
572 if ( utf8Len == 0 ) goto Done;
573 inUnit = *utf8In;
574 if ( inUnit >= 0x80 ) goto MultiByte; // ! Force linear execution path for ASCII.
575
576 unitCount = 1;
577 *cpOut = inUnit; // ! Don't put after Done, don't write if no input.
578
579Done:
580 *utf8Read = unitCount;
581 return;
582
583MultiByte:
584 CodePoint_from_UTF8_Multi ( utf8In, utf8Len, cpOut, utf8Read );
585 return;
586
587} // CodePoint_from_UTF8
588
589// =================================================================================================
590

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected