Am Mo., 25. Aug. 2025 um 06:00 Uhr schrieb 'Sainan' via lua-l
<
lu...@googlegroups.com>:
>
> print(utf8.len("プ")) --> 1
... so this strange char in your "..." is only one utf8 char...
(sorry, I can not identify this clearly, I can read neither Chinese
nor Japanese :) ...). Can you specfiy the Unicode number of this char?
But utf8.offset of your example anyway corresponds to the ref manual
correctly: the first (and only) utf8 char in your string then has 3
bytes, from byte 1 to 3. And the 2nd utf8 char is the one after with
zero bytes (so from char 4 to 4). And if you try to invoke offset for
higher "utf8 char" number, the function will fail, thus return nil.
And also #".."=3 also is correct, and utf8.len also correct... .