Converts a text string into a specific 'normal form'.

Built-in Function handler[edit | edit source]

Syntax:

normalizeText(<text>, <normalForm>)

Examples:

set the formSensitive to true
put "e" & numToCodepoint("0x301") into tExample        -- Acute accent
put tExample is "é" -- Returns false
put normalizeText(tExample, "NFC") is "é"            -- Returns true

Use the normalizeText function when you require a specific normal form of text.

Normalization is a process defined by the Unicode standard for removing minor encoding differences for a small set of characters and is more fully described in the normalizeText function. ]]Normalization does not avoid all problems with visually-identical characters; Unicode contains a number of characters that will (in the majority of fonts) be indistinguishable but are nonetheless completely different characters (a prime example of this is M and U+2164 ROMAN NUMERAL ONE THOUSAND).

Unless the formSensitive property is set to true, LiveCode ignores text normalization when performing comparisons.

Parameters:

  • text (string):
  • normalForm (enum):In Unicode text, the same visual string can be represented by differentcharacter sequences. A prime example of this is precomposed charactersand decomposed characters: an "e" followed by a combining acutecharacter is visually indistinguishable from a precombined "é"character. Because of the confusion that can result, Unicode defined anumber of "normal forms" that ensure that character representations areconsistent. The "compatibility" normal forms are designed by the UnicodeConsortium for dealing with certain legacy encodings and are notgenerally useful otherwise.
  • - "NFC": precomposed - "NFD": decomposed- "NFKC": compatibility precomposed- "NFKD": compatibility decomposed
  • Description:Use the normalizeText function when you require a specific normal formof text.

See also: formSensitive property (property),formSensitive (property),

Community content is available under CC-BY-SA unless otherwise noted.