blob: c0fb3c2769743145157396213379a1ab4dceebc4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
[char]
description = 'Receives zero or more integers, converts each one to its corresponding UTF-8 byte sequence and returns a string with the concatenation of all these sequences.'
[charpattern]
description = 'The pattern which matches exactly one UTF-8 byte sequence, assuming that the subject is a valid UTF-8 string.'
[codes]
description = [[
--------
Returns values so that the construction
```lua
for p, c in utf8.codes(s) do
body
end
```
will iterate over all UTF-8 characters in string s, with p being the position (in bytes) and c the code point of each character. It raises an error if it meets any invalid byte sequence.
]]
["codes Lua 5.4"]
description = [[
--------
```lua
for p, c in utf8.codes(s) do
body
end
```
]]
[codepoint]
description = 'Returns the codepoints (as integers) from all characters in `s` that start between byte position `i` and `j` (both included).'
["codepoint Lua 5.4"]
description = 'Returns the codepoints (as integers) from all characters in `s` that start between byte position `i` and `j` (both included).'
[len]
description = 'Returns the number of UTF-8 characters in string `s` that start between positions `i` and `j` (both inclusive).'
["len Lua 5.4"]
description = 'Returns the number of UTF-8 characters in string `s` that start between positions `i` and `j` (both inclusive).'
[offset]
description = 'Returns the position (in bytes) where the encoding of the `n`-th character of `s` (counting from position `i`) starts.'
|