1.1 --- a/WebStack/Generic.py Fri Aug 19 13:27:38 2005 +0000
1.2 +++ b/WebStack/Generic.py Fri Aug 19 20:20:58 2005 +0000
1.3 @@ -255,6 +255,21 @@
1.4 else:
1.5 return [value]
1.6
1.7 + # Public utility methods.
1.8 +
1.9 + def get_readable_path(self, path, encoding):
1.10 +
1.11 + """
1.12 + From the given 'path', use the given 'encoding' to decode the information and
1.13 + convert it to Unicode. Upon success, return the 'path' as a Unicode value. Upon
1.14 + failure, return None.
1.15 + """
1.16 +
1.17 + try:
1.18 + return urllib.unquote(path).decode(encoding)
1.19 + except UnicodeError:
1.20 + return None
1.21 +
1.22 # Server-related methods.
1.23
1.24 def get_server_name(self):