Wednesday, May 29, 2013

tornado decodes arguments as utf-8 by default

program crashed while calling RequestHandler.get_argument(), tried to avoid auto-decode before value returns, but seems not possible.

the comment of get_argument says:

        ...The returned values are always unicode.

and after i googled [tornado get_argument unicode], i found this:

see https://github.com/facebook/tornado/issues/407#issuecomment-2971210


so, it's very simple to handle this issue. just override method named "decode_argument".