Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Text.EncodeURLComponent
Encodes an URL component.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Text | 3.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
(old name: String.EncodeURLComponent)
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Text | The text to encode. | $URL | |
Encoding | The text encoding for text parameter. Default is native. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
"UTF-8" | Optional |
Result
Returns encoded string.
Description
Encodes an URL component.Please check what text encoding you want to use. Especially what the software processing the hex string expects.
Examples
Encode blog URL:
MBS("Text.EncodeURLComponent"; "http://www.mbsplugins.de")
Example result: "http%3A%2F%2Fwww%2Embsplugins%2Ede"
Encode file name for FTP URL:
"ftp://monkeybreadsoftware.com/path/" & MBS("Text.EncodeURLComponent"; $filename; "UTF-8")
Encode é in various encodings as URL:
MBS( "Text.EncodeURLComponent"; MBS( "Text.ConvertUnicodeToCharacterDecomposition"; "é" ); "UTF-8" ) & ¶ &
MBS( "Text.EncodeURLComponent"; MBS( "Text.ConvertUnicodeToCharacterComposition"; "é" ); "UTF-8" ) & ¶ &
MBS( "Text.EncodeURLComponent"; "é"; "Windows" ) & ¶ &
MBS( "Text.EncodeURLComponent"; "é"; "Mac" )
Example result:
e%CC%81
%C3%A9
%E9
%8E
Mount with properly encoding french accent:
Set Variable [ $path; Value: MBS( "Files.Mount"; "afp://stockage.madabout.lu/" & MBS( "Text.EncodeURLComponent"; MBS( "Text.ConvertUnicodeToCharacterDecomposition"; "Travail archivé" )); "UTF-8" )) ]
# URL is "afp://test.myserver.local/Travail%20archiv%8E"
Encode emoji:
MBS( "Text.EncodeURLComponent"; "🍎 🍓 🍒"; "UTF-8" )
Example result: %F0%9F%8D%8E%20%F0%9F%8D%93%20%F0%9F%8D%92
Enocode file name for SFTP upload:
Set Variable [$EncodedFileName; Value: MBS( "Text.EncodeURLComponent"; $FileName; "utf-8" ) ]
Set Variable [$result; Value: MBS("CURL.SetOptionURL"; $curl; "ftps://test.com/test/" & $EncodedFileName )]
See also
- CURL.SetOptionURL
- CURL.SetupAWS
- Files.Mount
- Shell.AddArgument
- Text.ConvertUnicodeToCharacterComposition
- Text.ConvertUnicodeToCharacterDecomposition
- Text.DecodeURLComponent
- WebView.LoadURL
Example Databases
- CURL/Amazon S3/Amazon S3 Download Picture
- CURL/Amazon S3/Amazon S3 Upload File
- CURL/Amazon S3/Amazon S3 Upload Picture
- CURL/Email/Office 365 oAuth SMTP
- CURL/WebServices/CURL FMS Admin API v18
- CURL/WebServices/WeatherBit.io test
Blog Entries
- SMTP with OAuth for Office 365 in FileMaker
- Storing files for download on FileMaker Server with download URLs
- MBS Filemaker Plugin, version 3.3pr4
- MBS Filemaker Plugin, version 3.2pr7
FileMaker Magazin
This function is free to use.
Created 18th August 2014, last changed 30th April 2024
