utf8kind(3)
π utf8kind(3) β Arcan Lua API
okay bestie, buckle up because we're talking about utf8kind from the Arcan Lua API and honestly? she's a little gremlin but she's ours π«Ά
β¨ NAME β¨
utf8kind β a quick little vibe check on an offset into a string π
πΈ SYNOPSIS πΈ
state
utf8kind( offset )
π¦ DESCRIPTION π¦
so like. built-in support for internationalized strings is fairly rudimentary in this whole setup π and yeah, the render_text class of functions does handle UTF-8 internally, but no such support has been mapped into the built-in LUA VM. none. zero. nada. π
that's where this function comes in β she's a quick helper to figure out if you're about to corrupt a UTF-8 string or not π lowkey a lifesaver.
the state values you get back are:
0β 7bit character1β start of char2β middle of char
that's the whole menu, bestie. three little numbers and a dream β¨
π NOTES π
- okay so real talk β this is very primitive and was added before we included the
bitopts- Lua JIT extension into the codebase π it does not directly help for validating UTF-8 sequences, only for avoiding obvious truncation. so don't come for her, she's doing her best π«Ά
π EXAMPLE π
function utf8kind0()
a = "Γ₯Àâ";
for i=1,#a do
print(utf8kind(a[i]));
end
end
look at her go πΊ iconic behaviour, no notes π
β sign-off β
and that's the whole page, bestie β shipped from the system corner of things, dated October 2026, and yeah she's still utf8kind(3) in case you forgot already π mwah, go forth and don't truncate your strings π§ββοΈπΈ
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms