Unquote.py

From PeformIQ Upgrade
Jump to navigation Jump to search

Script

A simple example of using the Python urllib module to decode a quoted string.

#!/usr/bin/env python

import urllib

str = """
        <input type="hidden" name="pecontexthandle" value="%3CPromptEngineRuntimeContext%20xmlns%3D%22http%3A%2F%2Fwww.crystaldecisions.com%2Freport%22%20xmlns%3Axsi%3D%22http%3A%2F
...
%3C%2FCascadingPID%3E%3C%2FWorkingUnits%3E%3CNextPID%3E2%3C%2FNextPID%3E%3C%2FPromptEngineRuntimeContext%3E" />
<input type="hidden" name="pevalue" value="" />
<link rel="stylesheet" type="text/css" href="../../../viewers/crystalreportviewers115/prompting/css/promptengine_default.css">

"""

decoded = urllib.unquote(str)

print decoded