perl -E 'use URI::Escape::JavaScript qw/escape unescape/; use Encode; $a = "яблоко"; Encode::_utf8_on($a); say escape($a);'
%u044F%u0431%u043B%u043E%u043A%u043E
from urllib import quote
query = 'яблоко'
print(quote(query))
%D1%8F%D0%B1%D0%BB%D0%BE%D0%BA%D0%BE