Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
utf8kind(3)			  Arcan Lua API 		     utf8kind(3)

NAME
     utf8kind - Quick check an offset into a string

SYNOPSIS
     state
     utf8kind( offset )

DESCRIPTION
     Built-in  support	for internationalized strings is fairly rudimentary, al-
     though the render_text class of functions handle UTF 8 internally, no  such
     support  has  been  mapped  into  the built-in LUA  VM . This function is a
     quick helper to determine if you're about to corrupt a  UTF  -8  string  or
     not.  state  values:  0  = 7bit character, 1 = start of char, 2 = middle of
     char.

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

EXAMPLE
     function utf8kind0()
	   a = "AYAxA<paragraph>";
	   for i=1,#a do
		 print(utf8kind(a[i]));
	   end
     end

system				   August 2026			     utf8kind(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=utf8kind&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help