模块 utf8

require "utf8"

公开 API

API实现说明
utf8.offsetbyteoffset返回 s 中第 n 个字符的字节偏移(n 为负从末尾数)
utf8.codepointcodepoint返回 s 从 i 到 j 的字符码点序列
utf8.charutfchar由若干码点构造 UTF-8 字符串
utf8.lenutflen返回 s 的字符数;无效序列返回 nil+位置(带 lax 时宽松)
utf8.codesiter_codes返回遍历 s 字符的迭代器,yield (字节偏移, 码点)
utf8.charpatternNULL匹配单个 UTF-8 字符的模式串
← 返回模块索引