# INVALID_ENCODING

A file could not be decoded.

- **HTTP class:** 400
- **Retryable:** no

## What happened

A file's content couldn't be decoded with its `encoding` (bad base64, invalid UTF-8), or its bytes don't match its extension.

## Fix

Send images, fonts and PDFs as base64 with `encoding` `"base64"`, and text as UTF-8; make sure each extension matches the real format. Each piece of a file sent in pieces must decode on its own.

## What to tell the user

Nothing.

## Agent hint

The exact `error.hint` text; Carnival fills each `<…>` for the call.

```text
<path> could not be decoded. Send images, fonts and PDFs as base64 with encoding "base64", and text as UTF-8.
```

## Related

- [`HASH_MISMATCH`](https://carnival-staging.dev/docs/errors/HASH_MISMATCH.md): A sha256 does not match its content.
- [`DISALLOWED_FILE_TYPE`](https://carnival-staging.dev/docs/errors/DISALLOWED_FILE_TYPE.md): This file type is not allowed.

All error codes: [error codes](https://carnival-staging.dev/docs/errors.md)
