Answer the question
In order to leave comments, you need to log in
How to pass Cyrillic in URL?
I am writing in Python 3. I need "fun" to be converted to %D0%B2%D0%B5%D1%81%D1%91%D0%BB%D0%BE%D0%B5 (and any word in general). Tried using code like this
#!/usr/bin/python
# -*- coding: utf-8 -*-
from urllib.parse import quote
name=input()
print(quote(name))
but on another PC everything is output right.
Answer the question
In order to leave comments, you need to log in
>>> import urllib.parse
>>>
>>> s = 'весёлое'
>>> urllib.parse.quote(s)
'%D0%B2%D0%B5%D1%81%D1%91%D0%BB%D0%BE%D0%B5'
>>>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question