UnZipFile.ReadAsText
--------------------

Reads the file with given index as text.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Compression](component_Compression.md) | [3.4](newinversion34.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "UnZipFile.ReadAsText"; Index { ; Encoding } ) 

**MBS**( **"UnZipFile.ReadAsText";** /\* Reads the file with given index as text. \*/  
**$Index**; /\* Index of the item from 0 to [UnZipFile.ItemCount](UnZipFileItemCount.md)-1. \*/   
**$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. "UTF8" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Index | Index of the item from 0 to [UnZipFile.ItemCount](UnZipFileItemCount.md)-1. | $index |  |
| 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). | "UTF8" | Optional |

### Result

Returns text value or error.

### Description

Reads the file with given index as text.  
If you want to decrypt an encrypted file, please use [UnZipFile.UsePassword](UnZipFileUsePassword.md) before calling this function.  
### Examples

Read text in variable:

 $text = MBS ( "UnZipFile.ReadAsText"; $Index )  
### See also

- [UnZipFile.ItemCount](UnZipFileItemCount.md)
- [UnZipFile.ReadAsHex](UnZipFileReadAsHex.md)
- [UnZipFile.UsePassword](UnZipFileUsePassword.md)
- [ZipFile.UsePassword](ZipFileUsePassword.md)

### Example Databases

- [Archives/Show Zip File Content](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Archives/Show%20Zip%20File%20Content.shtml#4ScriptAnchor_)

### FileMaker Magazin

- [Ausgabe 6/2013, Seite 32](https://filemaker-magazin.de/neuigkeit/3712-Appetithappen-FMM_201306)

This function checks for a license.

Created 18th August 2014 , last changed 12nd November 2015

  
[UnZipFile.ReadAsPNGContainer](UnZipFileReadAsPNGContainer.md) - [UnZipFile.ReadToFile](UnZipFileReadToFile.md)

[HTML Version](UnZipFileReadAsText.shtml)