Text.RedefineEncoding
---------------------

Takes a text in a given encoding and reencodes it with other encoding.

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

MBS( "Text.RedefineEncoding"; Text; InputEncoding; OutputEncoding ) 

**MBS**( **"Text.RedefineEncoding";** /\* Takes a text in a given encoding and reencodes it with other encoding. \*/  
**$Text**; /\* The text to process.e.g. "Hello World" \*/   
**$InputEncoding**; /\* The text encoding for the input text.e.g. "native" \*/   
**$OutputEncoding**) /\* The text encoding for the resulting string.e.g. "UTF-8" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Text | The text to process. | "Hello World" |
| InputEncoding | The text encoding for the input text.   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). | "native" |
| OutputEncoding | The text encoding for the resulting string.   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" |

### Result

Returns text or error.

### Description

Takes a text in a given encoding and reencodes it with other encoding.  
This can be used to fix bad imported texts.  
  
This function works on pure text, so any text style is lost.  
### Examples

Fix umlaut in Mac encoded UTF-8 text:

 MBS ( "Text.RedefineEncoding" ; "M√∂bel"; "mac" ; "UTF8" )  
Fix umlaut in Latin1 encoded UTF-8 text:

 MBS ( "Text.RedefineEncoding" ; "MÃ\\¶bel"; "Latin1"; "UTF-8" )  
\# needs a backslash so FileMaker doesn't evaluate ¶ to be a new line.   
### Example Databases

- [SmartCard/Belgian EID Reader](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SmartCard/Belgian%20EID%20Reader.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 5.2pr7](https://www.mbsplugins.de/archive/2015-07-16/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 10th July 2015 , last changed 28th January 2022

  
[Text.ReadTextFromContainer](TextReadTextFromContainer.md) - [Text.RemoveAccents](TextRemoveAccents.md)

[HTML Version](TextRedefineEncoding.shtml)