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

Function CodePoint_to_UTF8

xmpsdk/src/UnicodeConversions.cpp:491–511  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489// =================================================================================================
490
491void CodePoint_to_UTF8 ( const UTF32Unit cpIn, UTF8Unit * utf8Out, const size_t utf8Len, size_t * utf8Written )
492{
493 size_t unitCount = 0;
494
495 UC_Assert ( (utf8Out != 0) && (utf8Written != 0) );
496 if ( utf8Len == 0 ) goto Done;
497 if ( cpIn > 0x7F ) goto MultiByte; // ! Force linear execution path for ASCII.
498
499 if ( utf8Len == 0 ) goto Done;
500 unitCount = 1;
501 *utf8Out = UTF8Unit(cpIn);
502
503Done:
504 *utf8Written = unitCount;
505 return;
506
507MultiByte:
508 CodePoint_to_UTF8_Multi( cpIn, utf8Out, utf8Len, utf8Written );
509 return;
510
511} // CodePoint_to_UTF8
512
513// =================================================================================================
514

Callers

nothing calls this directly

Calls 1

CodePoint_to_UTF8_MultiFunction · 0.85

Tested by

no test coverage detected