Python requests function: url formatting unexpected ascii output -


i getting unexpected ascii characters while using requests library in python 3.

search_terms = ["ö", "é", "ä"] url = "http://www.domain.com/search"  in search_terms:     r = requests.get(url, i) 

which returns:

http://www.domain.com/search?%c3%b6 http://www.domain.com/search?%c3%a9 http://www.domain.com/search?%c3%a4 

although expected:

http://www.domain.com/search?%f6 http://www.domain.com/search?%e9 http://www.domain.com/search?%e4 

can explain happened , hint @ me how desired results?

i assume requests first encode unicode strings utf-8 , quote them.

>>> urllib.quote(u'ö'.encode('utf-8'))  %c3%b6 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -