from urllib import parse 
str1 = 'hahahaha'   
str2 = parse.quote(str1)   #quote() encodes the string    
print(str2)               < x2>#str2=haha%E5%93%88%E5%93%88

 

Original link: https://blog.csdn.net/RAPIER512/article/details/79761593

Leave a Reply