1. Matthew Schinckel
  2. werkzeug-main

Commits

mitsuhiko  committed f83c2ca

url routing system properly supports unicode URL rules now.

  • Participants
  • Parent commits 131f143
  • Branches default

Comments (0)

Files changed (3)

File CHANGES

View file
 -----------
 (codename to be selected, release date yet unknown)
 
+- url routing system properly supports unicode URL rules now.
+
 
 Version 0.5
 -----------

File tests/test_routing.py

View file
     try:
         adapter.match(u'/öäü')
     except RequestRedirect, e:
-        assert e.new_url == 'http://localhost/%C3%B6%C3%A4%C3%BC/
+        print repr(e.new_url)
+        assert e.new_url == 'http://localhost/%C3%B6%C3%A4%C3%BC/'
     else:
         raise AssertionError('expected request redirect exception')

File werkzeug/routing.py

View file
                     self.subdomain and self.subdomain + '.' or '',
                     self.server_name,
                     self.script_name[:-1],
-                    path_info.lstrip('/').encode(self.map.charset)
+                    url_quote(path_info.lstrip('/'), self.map.charset)
                 )))
             if rv is None:
                 continue
                             subdomain and subdomain + '.' or '',
                             self.server_name,
                             self.script_name[:-1],
-                            path.lstrip('/').encode(self.map.charset)
+                            url_quote(path.lstrip('/'), self.map.charset)
                         )))
             if rule.redirect_to is not None:
                 if isinstance(rule.redirect_to, basestring):