P
P
PRoGRamm_InG2021-07-28 14:38:23
Python
PRoGRamm_InG, 2021-07-28 14:38:23

How to convert Russian letters to encoding?

I made a parser, for this I needed a news site, I go into the search, I write, and there is this encoding in the address bar. Is there a function in Python to convert letters to this encoding, or where can I find something like its alphabet with letters (for example C3 = G)

Encoding: %C3%F0%F3%E7%E8%FF (Georgia)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ramis, 2021-07-28
@PRoGRamm_InG

import urllib.parse
text = 'Грузия'
res = text.encode('windows-1251')
print(urllib.parse.quote(res))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question