{"issue":{"created_at":"2011-12-01T00:27:20Z","state":"open","updated_at":"2011-12-01T00:27:20Z","comments":0,"user":{"gravatar_id":"37d081c393f95a14e2704af38ecc4c8d","id":26739,"url":"https://api.github.com/users/peterbe","avatar_url":"https://secure.gravatar.com/avatar/37d081c393f95a14e2704af38ecc4c8d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"peterbe"},"body":"I have another site that uses the latin-1 charset. Aka. iso-8859-1. It's got a form that submits to my tornado app (on a complete different domain name). When someone types in unicode, click submit and goes to my tornado server my tornado server fails on `self.get_argument('foo')` because it's the wrong encoding. \r\n\r\nThis is what ``self.request.arguments`` looks like:\r\n\r\n```\r\n {'foo': ['J\\xf6nk\\xf6ping']}\r\n```\r\n\r\nSo trying to decode that fails with utf-8. \r\n\r\n```python\r\n>>> x\r\n'J\\xf6nk\\xf6ping'\r\n>>> unicode(x, 'utf-8')\r\nTraceback (most recent call last):\r\nFile \"<stdin>\", line 1, in <module>\r\nUnicodeDecodeError: 'utf8' codec can't decode byte 0xf6 in position 1: invalid start byte\r\n>>> unicode(x, 'latin-1')\r\nu'J\\xf6nk\\xf6ping'\r\n```\r\n\r\nIf I could do this:\r\n\r\n```python\r\nfoo = self.get_argument('foo', encoding='latin1')\r\n```\r\n\r\nor this:\r\n\r\n```python\r\ntry:\r\n    foo = self.get_argument('foo')\r\nexcept UnicodeDecodeError:\r\n    foo = self.get_argument('foo', encoding='latin1')\r\n```\r\n\r\nWhat do you think? I could whip up a pull request to continue the discussion there if you like. ","assignee":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"id":2409443,"number":407,"labels":[],"title":"Ability to override encoding used in get_argument() maybe","html_url":"https://github.com/facebook/tornado/issues/407","closed_at":null,"url":"https://api.github.com/repos/facebook/tornado/issues/407","milestone":null},"action":"opened"}