utf8kind(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… 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 character
  • 1 β€” start of char
  • 2 β€” middle of char

that's the whole menu, bestie. three little numbers and a dream ✨


πŸŽ€ NOTES πŸŽ€

  1. 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