Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Decode string ?
#2
These are URL escape codes. Try using urllib.parse.unquote.

>>> import urllib
>>> s
'%27session%27%3A%27meLNaJb6kdYDjOHRzBdQzAjRArmpEi2r3PWVy0ujUZ4%27,%27user%27%3A1'
>>> urllib.parse.unquote(s)
"'session':'meLNaJb6kdYDjOHRzBdQzAjRArmpEi2r3PWVy0ujUZ4','user':1"
JohnnyCoffee likes this post
Reply


Messages In This Thread
Decode string ? - by JohnnyCoffee - Jan-11-2023, 12:07 AM
RE: Decode string ? - by bowlofred - Jan-11-2023, 12:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  code decode, string, image ... teckow 2 2,134 Aug-20-2021, 07:02 PM
Last Post: teckow
  how to encode and decode same value absolut 2 2,447 Sep-08-2020, 09:46 AM
Last Post: TomToad
  struct.decode() and '\0' deanhystad 1 3,342 Apr-09-2020, 04:13 PM
Last Post: TomToad
  Print string after decode martinzeifang 1 1,889 Jan-02-2020, 10:16 AM
Last Post: buran
  Getting decode error. shankar 8 10,586 Sep-20-2019, 10:05 AM
Last Post: tinman
  how to decode UTF-8 in python 3 oco 3 37,556 Jun-05-2018, 11:05 AM
Last Post: wavic
  Ask help for utf-8 decode/encode forfan 12 11,132 Feb-25-2017, 02:04 AM
Last Post: forfan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020