## TL;DR
The dump is working; the crash is sqlmap trying to print or write non-ASCII characters through an ascii-only channel, usually a misconfigured locale or an old Python. Run sqlmap in a UTF-8 locale, write results to a file instead of a narrow terminal, and update Python and sqlmap so accented or non-Latin data in the authorized test database stops killing the run.

```text
sqlmap "'ascii' codec can't encode characters" crash during dump on authorized target
```

## Use this when
- sqlmap crashes mid-dump with the ascii codec message when a row containing accented or non-Latin text arrives.
- The same dump of purely ASCII tables completes fine.

## Not for this skill when
- The dump fails before any rows return. That is an injection or session problem, not an encoding crash.
- The data itself must not leave the tester box under the engagement rules. Encoding fixes never override data handling terms.

## Steps
1. Confirm the trigger: note the table and row where the crash happens and whether that data contains non-ASCII characters. Verify: Verify: the crash point lines up with the first non-ASCII value.
2. Set a UTF-8 locale for the session, for example LANG set to a UTF-8 locale available on the box, and confirm Python reports UTF-8 as its preferred encoding. Verify: Verify: the encoding check prints UTF-8 before sqlmap starts.
3. Update Python and sqlmap to current versions, since old builds defaulted more code paths to ascii. Verify: Verify: version output shows the updated runtime and tool.
4. Rerun the dump for the authorized target writing output to a file with the dump format you need, instead of relying on terminal rendering. Verify: Verify: the previously crashing table dumps completely to the file.
5. Open the output file with a UTF-8 aware viewer and spot-check the non-ASCII rows against the application display, within the data handling rules. Verify: Verify: characters render correctly and row counts match the dump log.

## Variant phrasings
### sqlmap unicodeencodeerror ascii codec dump crash
The exception-name phrasing.
### sqlmap fails dumping table with accented characters
The data-shape phrasing.
### python locale utf-8 sqlmap output encoding
The environment-fix phrasing.

Compatibility: Compatibility: sqlmap on Python 3.x; locale names differ by distro, any available UTF-8 locale works.

## Why it happens
Python historically fell back to ascii for standard output and some file writes when the locale said so. Database content is not ascii-bounded, so the first accented name or non-Latin string in a dump raises the codec error and aborts the process, even though the extraction itself succeeded. A UTF-8 locale and current runtime remove the mismatch.

## Edge cases / pitfalls
- Forcing an encoding in the shell will not fix a downstream spreadsheet that mangles the file; open deliverables in a UTF-8 aware tool and check.
- Some rows may contain genuinely invalid byte sequences from legacy data; note those rows rather than silently dropping them.
- Keep dumped data handling inside the engagement terms: encrypted storage, named recipients, deletion at close.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_bvk2gWt3tVdOsPH8eRV8Fg
