SUniConvertUTF8to16
function · storm · primitive
- Address
0x65b350· 396 bytes, up to0x65b4db- Signature
int __stdcall (uint16_t *dst, uint32_t cap, const char *src, uint32_t len, uint32_t *written, uint32_t *read)- Meaning
- Converts UTF-8 to UTF-16 without validating it, 0xfffd past U+10FFFF; 0 at a NUL, 1 when full
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- Finding
- storm/unicode#converting-utf-8-to-utf-16
- Test
storm::utf8_to_utf16_whole
Finding: Converting UTF-8 to UTF-16 in storm: UTF-8 to UTF-16
SUniConvertUTF8to16(dst, cap, src, len, &written, &read) folds a sequence of n + 1 bytes as
v = (v << 6) + byte modulo 2^32, less the nth dword of 0x80e764. A v up to 0xffff is one unit, surrogates and overlong forms too, and 0 ends
the run with result 0; above 0x10ffff it is 0xfffd; between, the pair 0xd800 + ((v − 0x10000) >> 10),
0xdc00 + (v & 0x3ff). What does not fit in cap returns 1 unstored; a source that runs out returns
−1, a sequence past its end −(n + 1). written counts units with the NUL, read bytes without
its sequence; a null source or a len of 0 returns −1 and sets neither.
The derivation is in the doc.
Callers 26
- OsCreateFile unassigned
- OsGetFileAttributes unassigned
- 0x42a7b0 unassigned
- OsMoveFile os
- 0x42a8a0 os
- OsDeleteFile os
- OsCreateDirectory os
- 0x42aa30 os
- OsSetCurrentDirectory os
- EnumerateFolderFiles os
- 0x42b0d0 os
- SetWindowTextUtf8 unassigned
- ShowErrorText os
- SFileStat storm
- OpenLocalFile storm
- 0x64ba90 unassigned
- ILoadValue storm
- 0x64c760 storm
- SRegSaveString storm
- 0x662990 storm
- SDirOpen storm
- SDirNext storm
- 0x6c95d0 unassigned
- ValidateNameText unassigned
- ExpandKoreanParticles ui
- ExpandFrenchArticles ui
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.