Text.DecodeFromBytes
--------------------

Decode a byte string.

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

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

**MBS**( **"Text.DecodeFromBytes";** /\* Decode a byte string. \*/  
**$Text**; /\* The text to process.e.g. "65 66 67" \*/   
**$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.DecodeFromBytes)

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Text | The text to process. | "65 66 67" |  |
| 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 byte string.  
A byte string here is a text string with byte numbers like this: "65 66 67" which as text would be "ABC".  
### Examples

Decode Hex as UTF-8:

 MBS ( "Text.DecodeFromBytes"; "65 66 67"; "utf8" )  
<small>  
Example result: "ABC"</small>### See also

- [Text.DecodeFromBase64](TextDecodeFromBase64.md)
- [Text.DecodeFromHex](TextDecodeFromHex.md)
- [Text.DecodeFromHTML](TextDecodeFromHTML.md)
- [Text.DecodeFromURL](TextDecodeFromURL.md)
- [Text.DecodeFromXML](TextDecodeFromXML.md)
- [Text.EncodeToBytes](TextEncodeToBytes.md)

### Release notes

- **Version 9.3**
    - Fixed bug in [Text.DecodeFromBytes](http://www.mbsplugins.eu/TextDecodeFromBytes.shtml) function.

### Example Databases

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

### Blog Entries

- [MBS Filemaker Plugin, version 3.0pr8](https://www.mbsplugins.de/archive/2012-11-14/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

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

  
[Text.DecodeFromBase64URL](TextDecodeFromBase64URL.md) - [Text.DecodeFromHTML](TextDecodeFromHTML.md)

[HTML Version](TextDecodeFromBytes.shtml)