summaryrefslogtreecommitdiff
path: root/meta/template/utf8.lua
diff options
context:
space:
mode:
Diffstat (limited to 'meta/template/utf8.lua')
-rw-r--r--meta/template/utf8.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/template/utf8.lua b/meta/template/utf8.lua
new file mode 100644
index 00000000..cc4deca8
--- /dev/null
+++ b/meta/template/utf8.lua
@@ -0,0 +1,36 @@
+---@class utf8
+utf8 = {}
+
+---@param code integer
+---@vararg integer
+---@return string
+function utf8.char(code, ...) end
+
+utf8.charpattern = '[\0-\x7F\xC2-\xF4][\x80-\xBF]*'
+
+---@param s string
+---@param lax boolean?
+---@return fun():integer, integer
+function utf8.codes(s, lax) end
+
+---@param s string
+---@param i integer?
+---@param j integer?
+---@param lax boolean?
+---@return integer code
+---@return ...
+function utf8.codepoint(s, i, j, lax) end
+
+---@param s string
+---@param i integer?
+---@param j integer?
+---@param lax boolean?
+---@return integer?
+---@return integer errpos?
+function utf8.len(s, i, j, lax) end
+
+---@param s string
+---@param n integer
+---@param i integer
+---@return integer p
+function utf8.offset(s, n, i) end