1.1 --- a/WebStack/WSGI.py Tue Aug 23 18:06:18 2005 +0000
1.2 +++ b/WebStack/WSGI.py Tue Aug 23 18:08:30 2005 +0000
1.3 @@ -223,24 +223,26 @@
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 """
1.21
1.22 - # NOTE: Support at best ISO-8859-1 values.
1.23 -
1.24 fields = {}
1.25 for name, values in parse_qs(self.get_query_string(), keep_blank_values=1).items():
1.26 + name = self.decode_path(name, encoding)
1.27 fields[name] = []
1.28 for value in values:
1.29 - fields[name].append(unicode(value, "iso-8859-1"))
1.30 + value = self.decode_path(value, encoding)
1.31 + fields[name].append(value)
1.32 return fields
1.33
1.34 def get_fields_from_body(self, encoding=None):