Text.DecodeFromHex
------------------

Decode a hex string.

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

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

**MBS**( **"Text.DecodeFromHex";** /\* Decode a hex string. \*/  
**$Text**; /\* The text to process.e.g. "48656C6C6F20576F726C64" \*/   
**$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.DecodeFromHex)

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Text | The text to process. | "48656C6C6F20576F726C64" |  |
| 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 hex string.  
### Examples

Decode Hex as UTF-8:

 MBS ( "Text.DecodeFromHex"; "48656C6C6F20576F726C64"; "utf8" )  
<small>  
Example result: Hello World</small>Fix encoding of a string:

 MBS ("Text.DecodeFromHex"; MBS ("[Text.EncodeToHex](TextEncodeToHex.md)"; "&lt;string&gt;Eine M√∂bel-Handelsgesellschaft m.b.H&lt;/string&gt;"; "Native"); "UTF-8")  
<small>  
Example result: &lt;string&gt;Eine Möbel-Handelsgesellschaft m.b.H&lt;/string&gt;</small>Decode emojis:

 MBS ( "Text.DecodeFromHex"; "F09F8D8E20F09F8D9320F09F8D92"; "UTF-8" )  
<small>  
Example result: 🍎 🍓 🍒</small>### See also

- [Socket.Connect](SocketConnect.md)
- [Socket.WriteHex](SocketWriteHex.md)
- [Text.ConvertToTextEncoding](TextConvertToTextEncoding.md)
- [Text.DecodeFromBase64](TextDecodeFromBase64.md)
- [Text.DecodeFromBytes](TextDecodeFromBytes.md)
- [Text.DecodeFromHTML](TextDecodeFromHTML.md)
- [Text.DecodeFromURL](TextDecodeFromURL.md)
- [Text.DecodeFromXML](TextDecodeFromXML.md)
- [Text.EncodeToHex](TextEncodeToHex.md)

### Example Databases

- [Text functions/Encode Bytes as Base64](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Encode%20Bytes%20as%20Base64.shtml#1296FieldAnchor_)
- [Text functions/Repair Text Encoding Problems](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Repair%20Text%20Encoding%20Problems.shtml#1GroupButton24.0000000408.000000049.0000000643.0000000LayoutObjectAnchor_)
- [Text functions/Text Styles](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/Text%20Styles.shtml#4ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 5.3pr1](https://www.mbsplugins.de/archive/2015-08-26/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin 2.4 release notes](https://www.mbsplugins.de/archive/2011-10-11/MBS_Filemaker_Plugin_24_releas/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.4pr8](https://www.mbsplugins.de/archive/2011-07-04/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 31st January 2023

  
[Text.DecodeFromHTML](TextDecodeFromHTML.md) - [Text.DecodeFromQuotedPrintable](TextDecodeFromQuotedPrintable.md)

[HTML Version](TextDecodeFromHex.shtml)