MCPcopy Create free account
hub / github.com/ZDoom/Raze / GetCharFromString

Function GetCharFromString

source/common/utility/utf8.cpp:194–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192//==========================================================================
193
194int GetCharFromString(const uint8_t *&string)
195{
196 int z;
197
198 z = *string;
199
200 if (z < 192)
201 {
202 string++;
203
204 // Handle Windows 1252 characters
205 if (z >= 128 && z < 160)
206 {
207 return win1252map[z - 128];
208 }
209 return z;
210 }
211 else
212 {
213 int size = 0;
214 auto chr = utf8_decode(string, &size);
215 if (chr >= 0)
216 {
217 string += size;
218 return chr;
219 }
220 string++;
221 return z;
222 }
223}
224
225//==========================================================================
226//

Callers 2

MakeUTF8Function · 0.70
WideStringFunction · 0.70

Calls 1

utf8_decodeFunction · 0.85

Tested by

no test coverage detected