Text.DecodeFromBase64
---------------------

Decode a base 64 string.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Text](component_Text.md) | [3.0](newinversion30.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Text.DecodeFromBase64"; Text { ; Encoding } ) 

**MBS**( **"Text.DecodeFromBase64";** /\* Decode a base 64 string. \*/  
**$Text**; /\* The text to process.e.g. "R3LDvMOfIEdvdHQuIFRlc3Qg4pi6" \*/   
**$Encoding**) /\* Optional; The text encoding for result.   
Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.e.g. "UTF-8" \*/ 

(old name: String.DecodeFromBase64)

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Text | The text to process. | "R3LDvMOfIEdvdHQuIFRlc3Qg4pi6" |  |
| Encoding | The text encoding for result.    Default is native. This function can also handle UTF-16 as well as UTF-16LE and UTF-16BE for little/big endian byte order.   Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the [FAQ](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "UTF-8" | Optional |

### Result

Returns decoded text.

### Description

Decode a base 64 string.  
This is for text only. Data encoded as base64 would probably be truncated as FileMaker texts do not contain NULL bytes.  
### Examples

Decode Base64 as UTF-8:

 MBS ( "Text.DecodeFromBase64"; "R3LDvMOfIEdvdHQuIFRlc3Qg4pi6"; "utf8" )  
<small>  
Example result: "Grüß Gott. Test ☺"</small>### See also

- [Text.DecodeBytesFromBase64](TextDecodeBytesFromBase64.md)
- [Text.DecodeFromBase64URL](TextDecodeFromBase64URL.md)
- [Text.DecodeFromBytes](TextDecodeFromBytes.md)
- [Text.DecodeFromHex](TextDecodeFromHex.md)
- [Text.DecodeHexFromBase64](TextDecodeHexFromBase64.md)
- [Text.EncodeToBase64](TextEncodeToBase64.md)
- [TOTP.DecodeFromBase32](TOTPDecodeFromBase32.md)

### Example Databases

- [Text functions/Encode Bytes as Base64](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Encode%20Bytes%20as%20Base64.shtml#1294FieldAnchor_)
- [Text functions/Text Styles](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Text%20Styles.shtml#5ScriptAnchor_)

### Blog Entries

- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.0pr3](https://www.mbsplugins.de/archive/2012-10-19/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 11st December 2016

  
[Text.DecodeBytesFromBase64](TextDecodeBytesFromBase64.md) - [Text.DecodeFromBase64URL](TextDecodeFromBase64URL.md)

[HTML Version](TextDecodeFromBase64.shtml)