Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1    Statistic  


Encodes text as html.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Text 2.4 Yes Yes Yes Yes Yes

MBS( "Text.EncodeToHTML"; text { ; mode } )

(old name: String.EncodeToHTML)


Parameter Description Example value
text The text you want to encode. "Grüße"
mode Optional
Default 0 for using named entities.
Pass 1 for decimal and 2 for hex encoded numbers instead.


The encoded text.


Encodes text as html.
All special and unicode characters are escaped.
Lower ASCII control characters are ignored.

You may want to use Text.ReplaceNewline after this function to replace new line characters with <br> (mode 4) or <br /> (mode 5).


Encode text as html

MBS( "Text.EncodeToHTML"; "Grüße" )

Example result: "Gr&uuml;&szlig;e"

Encode smileys:

MBS("Text.EncodeToHTML"; "😀😁😂😃")

Example result: "&#128512;&#128513;&#128514;&#128515;"

Encode ä three ways:

MBS( "Text.EncodeToHTML"; "ä"; 0) & ¶ &
MBS( "Text.EncodeToHTML"; "ä"; 1) & ¶ &
MBS( "Text.EncodeToHTML"; "ä"; 2)

See also

Example Databases

Text.EncodeToBytes   -   Text.EncodeToHex

Feedback: Report problem or ask question.

MBS FileMaker blog