Function

uni_normqchk

Normalization quick check.

Since v1.0
unistat uni_normqchk(
uninormform form, const void *text, unisize text_len, uniattr text_attr, uninormchk *result)

Parameters 🔗

form in

Normalization form to check for.

text in

Input text.

text_len in

Number of code units in text or -1 if text is null terminated.

text_attr in

Attributes of text.

result out

Set to UNI_YES, UNI_NO, or UNI_MAYBE.

Return Value 🔗

UNI_OK

On success.

UNI_BAD_OPERATION

If text or result is NULL.

UNI_BAD_ENCODING

If text is malformed; this is never returned if text_attr has UNI_TRUST.

UNI_FEATURE_DISABLED

If Unicorn was built without support for normform.

Discussion 🔗

Performs a quick check to see if text is, is not, or might be normalized. For a definitive yes/no answer, use uni_normchk.

The implementation behaves as follows:

  • result is set to UNI_YES if all characters in text quick check to yes.
  • result is set to UNI_NO if at least one character in text is quick checks to no.
  • result is set to UNI_MAYBE if at least one character in text quick checks to maybe and no characters quick check to no.

Support for normalization quick check must be enabled in the JSON configuration file.

{
    "algorithms": {
        "normalizationQuickCheck": true
    }
}

See Also 🔗