# text.from_bytes · Rell standard library · Chromia Docs (concept)

> pure static function from_ bytes(bytes: byte_array , [ignore_errors: boolean ]): text Create a text representation of the given bytes. By default, an excep

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/text/from_bytes/

FUNCTION

# text.from\_bytes

```signature
pure static function from_bytes(bytes: byte_array, [ignore_errors: boolean]): text
```

Create a text representation of the given bytes.

By default, an exception is thrown if invalid UTF-8 characters are encountered, however if the
optional parameter `ignore_errors` is provided as `true`, invalid characters are instead replaced
with a placeholder.

**Parameters**

* **bytes** — The byte array to convert to text.
* **ignore\_errors** — if true, invalid characters are replaced with placeholders; if false, an exception is thrown (defaults to `false`)

**Throws**

* `exception` — if invalid UTF-8 characters are encountered and `ignore_errors` is `false`

Since 0.9.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/text/from_bytes.html)Generated API reference, mirrored from the live docs
