The data is UTF-8 encoded bytes escaped with URL quoting, so you want to decode, with urllib.parse.unquote(), which handles decoding from percent-encoded data to UTF-8 bytes and then to text, transparently:

from urllib.parse import unquote

url = unquote(url)

Demo:

>>> from urllib.parse import unquote
>>> url = 'example.com?title=%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D0%B2%D0%B0%D1%8F+%D0%B7%D0%B0%D1%89%D0%B8%D1%82%D0%B0'
>>> unquote(url)
'example.com?title=правовая+защита'

The Python 2 equivalent is urllib.unquote(), but this returns a bytestring, so you'd have to decode manually:

from urllib import unquote

url = unquote(url).decode('utf8')
Answer from Martijn Pieters on Stack Overflow
🌐
Python
docs.python.org › 3 › library › urllib.parse.html
urllib.parse — Parse URLs into components
To support easier conversion of result objects between str and bytes, all return values from URL parsing functions provide either an encode() method (when the result contains str data) or a decode() method (when the result contains bytes data). The signatures of these methods match those of the corresponding str and bytes methods (except that the default encoding is 'ascii' rather than 'utf-8').
🌐
URLDecoder
urldecoder.io › python
URL Decoding query strings or form parameters in Python | URLDecoder
In Python 3+, You can URL decode any string using the unquote() function provided by urllib.parse package.
🌐
URL Decode
urldecoder.org › dec › python
URL Decoding of "python" - Online
Decode python from URL-encoded format with various advanced options. Our site has an easy to use online tool to convert your data.
🌐
ProxiesAPI
proxiesapi.com › articles › url-encoding-and-decoding-in-python
URL Encoding and Decoding in Python | ProxiesAPI
February 6, 2024 - from urllib.parse import quote, unquote text = "Hello world" encoded = quote(text) # encoded is now "Hello world" decoded = unquote(encoded) # decoded is back to the original "Hello world" ... The main reason you'd use this in Python is building URLs programmatically.
🌐
GitHub
gist.github.com › nkentaro › 37f25b802e825da7ab3b7f27c0303047
url encode and decode in python3 · GitHub
The quote() function encodes space to . Python also has a quote_plus() function that encodes space to plus sign (+). I've written about URL Encoding in python on my website.
🌐
PyPI
pypi.org › project › URLDecoder
URLDecoder
March 17, 2023 - JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
Find elsewhere
🌐
Devzery
devzery.com › post › urlencode-python-mastering-url-encoding-in-python
Python URL Encoding Made Simple: Learn urlencode, Query Strings & API Handling!
April 21, 2025 - URL decoding is the reverse process of URL encoding, converting percent-encoded characters back to their original form. This is crucial when you receive encoded data in URLs and need to process it in its original format.
🌐
SSOJet
ssojet.com › escaping › url-escaping-in-python
URL Escaping in Python | Escaping Techniques in Programming
Python's urllib.parse module is indispensable for handling Uniform Resource Locators (URLs). It offers robust functions for both encoding and decoding URL components, ensuring that special characters are correctly represented.
🌐
MojoAuth
mojoauth.com › binary-encoding-decoding › percent-encoding-url-encoding-with-python
Percent-encoding (URL Encoding) with Python | Binary Encoding Techniques Across Programming Languages
When you encounter a URL or query string, you'll often need to convert percent-encoded characters back to their original form. The unquote() function from Python's urllib.parse module is your go-to tool for this. It takes a percent-encoded string ...
🌐
DEV Community
dev.to › k4ml › python-urldecode-on-command-line-2ek9
Python urldecode on command line - DEV Community
December 2, 2018 - alias urldecode='python3 -c "import sys, urllib.parse as ul;print(ul.unquote_plus(sys.argv[1]))"' Then you can use it as:- urldecode '"status":"SUCCESS"' "status":"SUCCESS" Now that's perfect. But the data that I want to decode must be passed through unix pipe, like this:- grep 'status: 504' /var/log/local0* | awk '{ print $10}' | xargs urldecode ·
🌐
Urldecoder
urldecoder.net › python-urldecode
Python unqoute() - URL Decode
>>> import urllib >>> url = u'http://example.com/?param=url decode' >>> urllib.unquote( url ).decode( 'utf8' ) >>> print urllib.unquote( url ).decode( 'utf8' ) http://example.com/?param=url encode · github.com/urldecoder/examples/blob/main/unquote.py · Python urlencode ·
🌐
URL Encoder
urlencoder.io › python
How to encode URLs in Python | URLEncoder
URL Encode online. URLEncoder is a simple and easy to use online tool to convert any string to URL Encoded format in real time. It also contains several articles on how to URL Encode a query string or form parameter in different programming languages.
🌐
Python-Fiddle
python-fiddle.com › tools › urldecoder
Online URL Decoder
URL decoding is the process of converting an encoded URL back to its original form by replacing the percent-encoded characters with their corresponding special characters.
🌐
Rosetta Code
rosettacode.org › wiki › URL_decoding
URL decoding - Rosetta Code
2 weeks ago - REPORT Z_DECODE_URL. DATA: lv_encoded_url TYPE string VALUE 'http://foo bar/', lv_decoded_url TYPE string. CALL METHOD CL_HTTP_UTILITY=>UNESCAPE_URL EXPORTING ESCAPED = lv_encoded_url RECEIVING UNESCAPED = lv_decoded_url.
🌐
Python
docs.python.org › 3 › library › urllib.request.html
urllib.request — Extensible library for opening URLs
As the python.org website uses utf-8 encoding as specified in its meta tag, we will use the same for decoding the bytes object: >>> with urllib.request.urlopen('http://www.python.org/') as f: ... print(f.read(100).decode('utf-8')) ...
🌐
URL Decode
urldecoder.org
URL Decode and Encode - Online
Decode from URL-encoded format or encode into it with various advanced options. Our site has an easy to use online tool to convert your data.
🌐
FusionAuth
fusionauth.io › dev-tools › url-encoder-decoder
Online URL Encoder & Decoder
This tool can be used to encode or decode URL parameters. It won't handle full URLs currently, but you can input parameters that are part of the query string and this will decode them.