Topics
All
Mac OS X
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Guides
Examples
New in version:
7.4
7.5
8.0
8.1
8.2
8.3
8.4
8.5
9.0
9.1
Statistic
Text.EncodeToHTML
Encodes text as html.
Component | Version | macOS | Windows | Server | FileMaker Cloud | FileMaker iOS SDK |
Text | 2.4 | Yes | Yes | Yes | Yes | Yes |
(old name: String.EncodeToHTML)
Parameters
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. Add 8 to encode all characters (new in plugin version 8.4) |
0 |
Result
The encoded text.
Description
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).
Examples
Encode text as html
MBS( "Text.EncodeToHTML"; "Grüße" )
Example result: "Grüße"
Encode smileys:
MBS("Text.EncodeToHTML"; "😀😁😂😃")
Example result: "😀😁😂😃"
Encode ä three ways:
MBS( "Text.EncodeToHTML"; "ä"; 0) & ¶ &
MBS( "Text.EncodeToHTML"; "ä"; 1) & ¶ &
MBS( "Text.EncodeToHTML"; "ä"; 2)
Encode normal and all with decimal or hexadecimal:
MBS("Text.EncodeToHTML"; "Hello World ä"; 0) & ¶ &
MBS("Text.EncodeToHTML"; "Hello World ä"; 8) & ¶ &
MBS("Text.EncodeToHTML"; "Hello World ä"; 8+2)
Example result:
"Hello World ä
Hello World ä
Hello World ä"
See also
- SendMail.SetHTMLText
- Text.DecodeFromHTML
- Text.EncodeToBytes
- Text.EncodeToHex
- Text.EncodeToURL
- Text.EncodeToXML
- Text.ReplaceNewline
- Text.TextToHTML
Example Databases
- CURL/Email/Batch Emailer
- CURL/Email/Build and send HTML Email with inline graphic
- Text functions/HTML Conversion with UTF32
Blog Entries
- Smileys and UTF32
- MBS FileMaker Plugin, version 8.4pr8
- MBS FileMaker Plugin, version 7.2pr6
- MBS FileMaker Plugin, version 5.1pr5
- MBS FileMaker Plugin, version 5.0pr7
Created 18th August 2014, last changed 13th September 2018
Text.EncodeToBytes - Text.EncodeToHex
Feedback: Report problem or ask question.
Links
MBS Xojo Plugins