Answer the question
In order to leave comments, you need to log in
How to translate the encoded Russian file name by nginx back into the Russian file name on the Django(python) side?
How to translate the encoded Russian file name by nginx back into the Russian file name on the Django(python) side?
There is a file: Hi.mp4
nginx encodes it to %D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82.mp4
and I can't recode it back into Russian
characters do in python "Hi".encode('utf8')
then I get b'\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82'
and it's different from what it sends nginx
Answer the question
In order to leave comments, you need to log in
from urllib import parse
parse.unquote('%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82.mp4')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question