MCPcopy Create free account
hub / github.com/StereoKit/StereoKit / utf16_encode

Function utf16_encode

StereoKitC/libraries/unicode.cpp:370–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368///////////////////////////////////////////
369
370int32_t utf16_encode(char16_t *out, char32_t utf) {
371 if (utf < 0x00010000L) {
372 out[0] = (char16_t)utf;
373 return 1;
374 } else if (utf < 0x00110000L) {
375 utf -= 0x00010000L;
376
377 out[0] = ((utf >> 10) & 0x3ff) | 0xd800;
378 out[1] = ((utf >> 0 ) & 0x3ff) | 0xdc00;
379 return 2;
380 }
381 return 0;
382}
383
384///////////////////////////////////////////
385

Callers 2

utf_insert_charFunction · 0.85
utf16_encode_appendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected