Commits

Robert Brewer committed cb0c51c

utf8 decode test.

Comments (0)

Files changed (1)

cherrypy/test/test_encoding.py

             return sing8
         utf8.exposed = True
         utf8._cp_config = {'tools.encode.encoding': 'utf-8'}
+        
+        def reqparams(self, *args, **kwargs):
+            return repr(cherrypy.request.params)
+        reqparams.exposed = True
     
     class GZIP:
         def index(self):
         europoundUtf8 = europoundUnicode.encode('utf-8')
         self.getPage('/?param=%s' % europoundUtf8)
         self.assertBody(europoundUtf8)
+        
+        # Make sure that encoded utf8 gets parsed correctly
+        self.getPage("/reqparams?q=%C2%A3")
+        self.assertBody(r"{'q': '\xc2\xa3'}")
     
     def testEncoding(self):
         # Default encoding should be utf-8