Method

# DecodeBase64

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

This function returns the original, unencoded string when passed a Base64-encoded string.

## Usage

``` xojo
result = DecodeBase64(str, encoding)
```

| Part     | Type                                                 | Description                                                |
|----------|------------------------------------------------------|------------------------------------------------------------|
| result   | `String</api/data_types/string>`                     | The decoded value of *str*.                                |
| str      | `String</api/data_types/string>`                     | The Base64 `String</api/data_types/string>` to be decoded. |
| encoding | `TextEncoding</api/text/encoding_text/textencoding>` | Optional: The text encoding of the passed string.          |

## Notes

The <span class="title-ref">DecodeBase64</span> function performs the reverse operation of `EncodeBase64</api/text/encoding_text/encodebase64>`.

## Sample code

The following code decodes a string back into ASCII:

``` xojo
Var encoded, decoded As String
encoded = EncodeBase64("How now brown cow.", 0)
decoded = DecodeBase64(encoded)

MessageBox(decoded)
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

- `EncodeBase64</api/text/encoding_text/encodebase64>` function.
- [Base64 encoding on Wikipedia](https://en.wikipedia.org/wiki/Base64)

</div>
