Utf8DecodeChar
function · lua · primitive
- Address
0x7fbeb0· 256 bytes, up to0x7fbfaf- Meaning
- Decodes one UTF-8 sequence of up to six bytes and returns its code and length
- Confidence
- verified, proof one
- Finding
- lua/libs#case-mapping
Finding: Case mapping in lua: the libraries
str_lower and str_upper walk a string by UTF-8 code points: Utf8DecodeChar reads one
and answers its length, LowerCodepoint or UpperCodepoint maps it, Utf8EncodeChar writes it
back. Lowering maps A to Z and 0xc0 to 0xde up by 32, raising maps a to z and 0xe0 to
0xfe down by 32. A byte that is not valid UTF-8 decodes to 0x80000000, which encodes to no
bytes, so it is dropped. A NUL byte decodes to -1 and consumes nothing, and the call never returns.
| function | name | decided by |
|---|---|---|
0x7fbdf0 | str_lower | Utf8DecodeChar (0x7fbe2d), LowerCodepoint (0x7fbe34), Utf8EncodeChar (0x7fbe3e), advance by the length (0x7fbe8a) |
0x7fc0c0 | str_upper | the same loop with UpperCodepoint (0x7fc104) |
0x7fbeb0 | Utf8DecodeChar | lead-byte masks 0xfc, 0xf8, 0xf0, 0xe0, 0xc0 (0x7fbef2..0x7fbf4e), continuation test 0xc0 == 0x80 (0x7fbf7c) |
0x7fbfb0 | Utf8EncodeChar | limits 128, 2048, 65536, 2097152, 4194304 and 2147483648 (0x7fbfb6..0x7fc05a) |
0x7fc0a0 | LowerCodepoint | ranges 0x41..0x5a and 0xc0..0xde (0x7fc0a2..0x7fc0b3), plus 32 |
0x7fc180 | UpperCodepoint | ranges 0x61..0x7a and 0xe0..0xfe (0x7fc182..0x7fc193), minus 32 |
The derivation is in the doc.
Callers 2
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.