Best way to convert a Unicode URL to ASCII (UTF-8 percent-escaped) in Python?

前端 未结 5 1514
情话喂你
情话喂你 2020-12-12 13:30

I\'m wondering what\'s the best way -- or if there\'s a simple way with the standard library -- to convert a URL with Unicode chars in the domain name and path to the equiva

5条回答
  •  春和景丽
    2020-12-12 14:19

    there's some RFC-3896 url parsing work underway (e.g. as part of the Summer Of Code) but nothing in the standard library yet AFAIK -- and nothing much on the uri encoding side of things either, again AFAIK. So you might as well go with MizardX's elegant approach.

提交回复
热议问题