Friday, March 25, 2016

Python: Percent-encode Multibyte String

Percent-encode multibyte string:

$ python -c "import urllib, sys; print urllib.quote(sys.argv[1])" 織田信長

Output:

%E7%B9%94%E7%94%B0%E4%BF%A1%E9%95%B7