开发者

How to convert text into URL syntax on Python?

开发者 https://www.devze.com 2022-12-12 12:02 出处:网络
I want to convert Python string to URL syntax. For example >>> u\'한글\'.enco开发者_JS百科de(\'utf-8\')

I want to convert Python string to URL syntax.

For example

>>> u'한글'.enco开发者_JS百科de('utf-8')
'\xed\x95\x9c\xea\xb8\x80' to '%ed%95%9c%ea%b8%80'


>>> import urllib2
>>> urllib2.quote('한글')
'%ED%95%9C%EA%B8%80'
0

精彩评论

暂无评论...
验证码 换一张
取 消