MCPcopy Create free account
hub / github.com/DFHack/dfhack / decode

Function decode

library/MiscUtils.cpp:536–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534};
535
536static inline uint32_t
537decode(uint32_t* state, uint32_t* codep, uint8_t byte) {
538 uint32_t type = utf8d[byte];
539
540 *codep = (*state != UTF8_ACCEPT) ?
541 (byte & 0x3fu) | (*codep << 6) :
542 (0xff >> type) & (byte);
543
544 *state = utf8d[256 + *state + type];
545 return *state;
546}
547
548/* Character encoding */
549

Callers 1

UTF2DFFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected