1.1 --- a/WebStack/BaseHTTPRequestHandler.py Tue Aug 23 18:06:18 2005 +0000
1.2 +++ b/WebStack/BaseHTTPRequestHandler.py Tue Aug 23 18:08:30 2005 +0000
1.3 @@ -233,12 +233,14 @@
1.4
1.5 # Higher level request-related methods.
1.6
1.7 - def get_fields_from_path(self):
1.8 + def get_fields_from_path(self, encoding=None):
1.9
1.10 """
1.11 Extracts fields (or request parameters) from the path specified in the
1.12 transaction. The underlying framework may refuse to supply fields from
1.13 - the path if handling a POST transaction.
1.14 + the path if handling a POST transaction. The optional 'encoding'
1.15 + parameter specifies the character encoding of the query string for cases
1.16 + where the default encoding is to be overridden.
1.17
1.18 Returns a dictionary mapping field names to lists of values (even if a
1.19 single value is associated with any given field name).
1.20 @@ -248,9 +250,11 @@
1.21
1.22 fields = {}
1.23 for name, values in parse_qs(self.get_query_string(), keep_blank_values=1).items():
1.24 + name = self.decode_path(name, encoding)
1.25 fields[name] = []
1.26 for value in values:
1.27 - fields[name].append(unicode(value, "iso-8859-1"))
1.28 + value = self.decode_path(value, encoding)
1.29 + fields[name].append(value)
1.30 return fields
1.31
1.32 def get_fields_from_body(self, encoding=None):