Two headers protect names: identifier.h decides what an identifier may contain (UAX #31), and security.h detects names that can pass for each other or mix scripts suspiciously (UTS #39). Security is an optional component that needs normalization; see Build options.
muniIsIdentifierStart and muniIsIdentifierContinue give the XID_Start and XID_Continue properties; muniIsPatternSyntax and muniIsPatternWhiteSpace the characters a language reserves for syntax and spacing. muniCheckIdentifier reports where a string stops being a default identifier: an XID_Start code point followed by XID_Continue code points. A scripting language or a configuration format uses these for its names. Compare identifiers by their NFKC_Casefold, see Normalization and case.
For user names in chat, account names and the like:
muniGetSkeleton maps a string to its skeleton. Two strings are confusable when their skeletons are equal: "paypal" written with a Cyrillic "а" has the skeleton of the Latin one. Store a skeleton next to each name and compare bytes.muniGetRestrictionLevel grades how a string mixes scripts under the General Security Profile, from ASCII only to unrestricted. Moderately restrictive (Latin with one other recommended script, but not Cyrillic or Greek) is a common limit for user names.muniGetResolvedScripts lists the scripts every character of a string can belong to; none means the string mixes scripts.muniCheckMixedNumbers finds digits from more than one decimal system, some of which look alike.muniIsIdentifierAllowed tells whether a code point has Identifier_Status Allowed.samples/names.c combines these into a user name policy: NFKC first, then refuse mixed scripts and mixed digits, key the account by NFKC_Casefold, and refuse a name whose skeleton is taken.
muni_errorCapacity with neededOut 0 for any text, even text that skips bidi. muni_bidiLeftToRight gives the skeleton UTS #39 calls skeleton; text without right-to-left characters has the same skeleton in automatic and left-to-right paragraphs, and skips bidi entirely.muniGetResultsVersion beside stored skeletons and verdicts, such as an accepted identifier or its restriction level, and recompute them when it changes.muniCheckIdentifier.muniGetResolvedScripts counts Han as also Japanese, Korean and Han with Bopomofo or Latin, as UTS #39 asks; an array of MUNI_MAX_RESOLVED_SCRIPTS entries always suffices for this Unicode version, and a release with a new one may raise it.