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

Function Utf8BytesIndicated

lib/yamlcpp/src/emitterutils.cpp:64–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64int Utf8BytesIndicated(char ch) {
65 int byteVal = static_cast<unsigned char>(ch);
66 switch (byteVal >> 4) {
67 case 0:
68 case 1:
69 case 2:
70 case 3:
71 case 4:
72 case 5:
73 case 6:
74 case 7:
75 return 1;
76 case 12:
77 case 13:
78 return 2;
79 case 14:
80 return 3;
81 case 15:
82 return 4;
83 default:
84 return -1;
85 }
86}
87
88bool IsTrailingByte(char ch) { return (ch & 0xC0) == 0x80; }
89

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected