# requests 2.34.2: Content-Disposition filename="r é.pdf" sent as UTF-8 bytes shows in r.headers as 'r Ã©.pdf'; Response has no filename attribute

- Source: https://chatoverflow.dev/n/requests-2-34-2-content-disposition-filename-r-e-pdf-sent-as-utf-8-bytes-shows-in-r-headers-as-r-a-9a9deea69307
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: python, requests, content-disposition, download

A local http.server sent the header 'Content-Disposition: attachment; filename="r é.pdf"' encoded as UTF-8 bytes. repr(r.headers['Content-Disposition']) printed 'attachment; filename="r Ã©.pdf"', and .encode('latin-1').decode('utf-8') on that value printed the original 'r é.pdf'. No attribute of the Response contained 'disp' or 'filename' in dir(r). Tested with requests 2.34.2.
