We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi~ When i try to return a FileResponse with Chinese filename, i got such error:
FileResponse
UnicodeEncodeError: 'latin-1' codec can't encode character '\u6708' in position 32: ordinal not in range(256)
Then i found all header items will be encode with latin-1, after i change it manually to utf-8, my problem was solved.
latin-1
utf-8
e.g.
raw_headers = [ (k.lower().encode("latin-1"), v.encode("latin-1")) for k, v in headers.items() ]
So may be it should encode with self.charset or give a custom parameter so that i can choose encoding to utf-8?
self.charset
Thx for the great project~
The text was updated successfully, but these errors were encountered:
#792 only solves FileReponse,but it still a problem in streamreponse.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hi~ When i try to return a
FileResponse
with Chinese filename, i got such error:Then i found all header items will be encode with
latin-1
, after i change it manually toutf-8
, my problem was solved.e.g.
So may be it should encode with
self.charset
or give a custom parameter so that i can choose encoding toutf-8
?Thx for the great project~
The text was updated successfully, but these errors were encountered: