utf8

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。



APIリファレンス
関数
char
utf8.char(codepoints:Tuple<number>):string
パラメータ
codepoints:Tuple<number>
戻り値
コードサンプル
Utf8 文字

codes
utf8.codes(str:string):function,string,number
パラメータ
str:string
コードサンプル
Utf8 コード

codepoint
utf8.codepoint(
str:string, i:number, j:number
パラメータ
str:string
既定値: 1
既定値: i
戻り値
コードサンプル
Utf8 コードポイント

len
utf8.len(
パラメータ
既定値: 1
既定値: -1
戻り値
コードサンプル
Utf8 Len

offset
utf8.offset(
パラメータ
既定値: 1
戻り値
コードサンプル
Utf8 オフセット

graphemes
utf8.graphemes(
str:string, i:number, j:number
パラメータ
str:string
戻り値
コードサンプル
Utf8 グラフェム
-- "e" の後に結合アクセントが付いたものは1つのグラフェムですが、2つのコードポイントです
local str = "ae\u{0301}b"
print(utf8.len(str)) --> 4
for first, last in utf8.graphemes(str) do
local grapheme = string.sub(str, first, last)
print(first, last, #grapheme)
end
--> 1 1 1
--> 2 4 3
--> 5 5 1

nfcnormalize
utf8.nfcnormalize(str:string):string
パラメータ
str:string
戻り値
コードサンプル
Utf8 NFC 正規化
local decomposed = "e\u{0301}" -- "e" と結合アクセントの組み合わせ
local composed = utf8.nfcnormalize(decomposed)
print(utf8.len(decomposed)) --> 2
print(utf8.len(composed)) --> 1
print(composed == "\u{00E9}") --> true

nfdnormalize
utf8.nfdnormalize(str:string):string
パラメータ
str:string
戻り値
コードサンプル
Utf8 NFD 正規化
local composed = "\u{00E9}" -- 事前に合成された "é"
local decomposed = utf8.nfdnormalize(composed)
print(utf8.len(composed)) --> 1
print(utf8.len(decomposed)) --> 2
print(decomposed == "e\u{0301}") --> true

プロパティ
charpattern
utf8.charpattern:string
コードサンプル
Utf8 キャラクターパターン

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。