Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Text.EncodeToHTML
Encodes text as html.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Text | 2.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
(old name: String.EncodeToHTML)
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
text | The text you want to encode. | "Grüße" | |
mode | 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 | Optional |
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 ä"
Encode some fruits:
MBS( "Text.EncodeToHTML"; "🍎 🍓 🍒" )
Example result: 🍎 🍓 🍒
See also
- SendMail.SetHTMLText
- Text.DecodeFromHTML
- Text.EncodeToBytes
- Text.EncodeToHex
- Text.EncodeToURL
- Text.EncodeToXML
- Text.ReplaceNewline
- Text.TextToHTML
- WinSendMail.AddAttachmentText
Release notes
- Version 10.3
- Fixed Text.EncodeToHTML to handle single apostrophes correctly.
- Version 8.4
- Added new mode to Text.EncodeToHTML to encode all characters.
- Version 7.2
- Added more parameter for Text.EncodeToHTML to decide how to encode entities.
- Fixed problem in Text.EncodeToHTML where it did not ignore low ascii characters.
Example Databases
- CURL/Email/Batch Emailer
- CURL/Email/Build and send HTML Email with inline graphics
- CURL/Email/IMAP Email
- Text functions/HTML Conversion with UTF32
- WebHook/WebHook to serve html
- WebViewer/Text To WebViewer
Blog Entries
- Add a WebViewer to an Overlay window
- Sending email with a huge custom function
- MBS FileMaker Plugin, version 10.3pr9
- Text to Webviewer Script for FileMaker
- Smileys and UTF32
- MBS FileMaker Plugin, version 8.4pr8
- MBS FileMaker Plugin, version 7.2pr6
- MBS FileMaker Plugin, version 5.1pr5
- Sending Email with FileMaker via MBS Plugin
- MBS Filemaker Plugin 2.4 release notes
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 31st January 2023