MCPcopy Create free account
hub / github.com/apache/trafficserver / SplitUtf16HighChar

Function SplitUtf16HighChar

lib/yamlcpp/test/integration/encoding_test.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool SplitUtf16HighChar(std::ostream& stream, EncodingFn encoding, int ch) {
39 int biasedValue = ch - 0x10000;
40 if (biasedValue < 0) {
41 return false;
42 }
43 int high = 0xD800 | (biasedValue >> 10);
44 int low = 0xDC00 | (biasedValue & 0x3FF);
45 encoding(stream, high);
46 encoding(stream, low);
47 return true;
48}
49
50void EncodeToUtf16LE(std::ostream& stream, int ch) {
51 if (!SplitUtf16HighChar(stream, &EncodeToUtf16LE, ch)) {

Callers 2

EncodeToUtf16LEFunction · 0.85
EncodeToUtf16BEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected