MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Utf8CodepointBytes

Function Utf8CodepointBytes

engine/Poseidon/Foundation/Strings/Mbcs.cpp:140–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138} // namespace
139
140int Utf8CodepointBytes(const char* text)
141{
142 if (!text || !*text)
143 return 0;
144
145 int step = Utf8SequenceLength(static_cast<unsigned char>(text[0]));
146 for (int i = 1; i < step; ++i)
147 {
148 unsigned char c = static_cast<unsigned char>(text[i]);
149 if (c == 0 || !IsUtf8ContinuationByte(c))
150 return i;
151 }
152 return step;
153}
154
155int DecodeUtf8Codepoint(const char* text, uint32_t* outCodepoint)
156{

Callers 7

FormatMarqueeMethod · 0.85
Utf8CharBytesFunction · 0.85
DecodeUtf8CodepointFunction · 0.85
CountUtf8CodepointsFunction · 0.85
Utf8AdvanceCodepointsFunction · 0.85
NextTextElementPosFunction · 0.85

Calls 2

Utf8SequenceLengthFunction · 0.85
IsUtf8ContinuationByteFunction · 0.85

Tested by

no test coverage detected