I need to convert a cyrillic string to its urlencoded version in Windows-1251 encoding. For the following example string:
Моцарт
The correct result should be:
%CC%EE%F6%E0%F0%F2
In PHP, I would simply do the following:
$request = urlencode(iconv("UTF-8", "windows-1251", "Моцарт"));
echo $request;
How to accomplish the same goal in Python?