Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Text.ConvertUnicodeToCharacterComposition

Converts text by applying unicode character normalization.

Component Version macOS Windows Linux Server iOS SDK
Text 5.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Text.ConvertUnicodeToCharacterComposition"; Text )   More

Parameters

Parameter Description Example
Text The text to process. "Hello"

Result

Returns text or error.

Description

Converts text by applying unicode character normalization.
This function replaces character represented by decomposed representation with the composed representation.

see also
https://en.wikipedia.org/wiki/Unicode_equivalence

Rewritten for version 12.1 to preserve text styles and be quicker.

Examples

Test function:

#some text
Set Variable [$text; Value:"ä ö ü"]
#now make decomposed
Set Variable [$decomposedText; Value:MBS("Text.ConvertUnicodeToCharacterDecomposition"; $text)]
#and composed again
Set Variable [$composedText; Value:MBS("Text.ConvertUnicodeToCharacterComposition"; $decomposedText)]
#Now show results. See the 776 for the Diaeresis?
Show Custom Dialog ["Result"; $text & " " & MBS("Text.Characters"; $text) & ¶ & $decomposedText & " " & MBS("Text.Characters…]

Test character composition with ä and Char function:

MBS("Text.Characters"; MBS( "Text.ConvertUnicodeToCharacterComposition"; Char(97) & Char(776) ))

Example result: 228

Test functions:

Let([
i = "tränenüberströmt";
r = MBS( "Text.ConvertUnicodeToCharacterDecomposition"; i);
t = MBS( "Text.Characters"; r)

];
r & ¶ & t & ¶ &
"before " & MBS("Text.Length"; i) & ", after " & MBS("Text.Length"; r))

Example result:
tränenüberströmt
116 114 97 776 110 101 110 117 776 98 101 114 115 116 114 111 776 109 116
before 16, after 19

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 3th August 2015, last changed 31st January 2022


Text.ConvertToTextEncoding - Text.ConvertUnicodeToCharacterDecomposition