Re: Conversion of http escape characters

N.G.Smith (
Wed, 15 Jun 94 09:26:47 BST

In article <> (Michael McLay) writes:
>N.G.Smith writes:
> > Is there a neat canned solution to the problem of converting the escaped
> > characters used in http back to normal characters?
>Here's my module. It masks the CGI interface inside a class named
>FormContent. The constructor includes the algorithm that parses the
>name/value pairs and then the escaped characters that are returned by

Thanks for the code.

>class FormContent:
> def __init__(self):
> if os.environ['QUERY_STRING'] != '':
> self.qs = os.environ['QUERY_STRING']
> else:
> self.qs = sys.stdin.readline()

But, is this bit safe as far as the http specification is concerned?

I'm no expert, but as I understood it, shouldn't it be ...

if os.environ['REQUEST_METHOD'] == 'POST':
self.qs =['CONTENT_LENGTH']))
self.qs = os.environ['QUERY_STRING']

... or similar.

Thanks again,