-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
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
How to post file that filename include chinese name #4075
Comments
The decoding looks correct.
|
Is it related to #4012 ? |
Thanks! data = FormData(quote_fields=False)
filename = parse.unquote('中文.md')
data.add_field('file',
open('中文.md', 'rb'),
content_type='application/md',
filename='中文.md'
) It work |
I think this is related to #4012, but with my patch #4031 the quote_fields=False will still be needed. With the default it'll still perform the file name encoding. What the patch #4031 would help is that quote_fields=False will escape any quotes in the file name so that the result will still parse correctly. |
The spec recommends using ASCII only, so the default behaviour here seems correct, with quote_fields available to disable it. |
Long story short
I want to post a file to jira api, but not get a chinese name response
How to post file that filename include chinese name
Expected behaviour
{...
"filename":"中文.md",
...}
Actual behaviour
{...
"filename":"%E6%9C%AA%E5%91%BD%E5%90%8D.md",
...}
Steps to reproduce
I got the response, the filename incorrect
if I use curl command, I got the Expected result
Your environment
python: 3.6.5
OS: windows 10
The text was updated successfully, but these errors were encountered: