Identifiers and security

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.

Identifiers

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.

Names people read

For user names in chat, account names and the like:

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.

Not obvious