cloud-docs icon indicating copy to clipboard operation
cloud-docs copied to clipboard

Japanese cannot be processed when using flask

Open ghost opened this issue 3 years ago • 0 comments

Discussed in https://github.com/orgs/deta/discussions/477

Originally posted by mochidukiyukimi September 14, 2022 "UnicodeEncodeError" occurs when trying to process a Japanese query. ~~Probably a wsgi error.~~ Traceback (most recent call last):   File "/opt/python/detalib/debugger.py", line 131, in wrap     return func(event, context)   File "/var/task/_entry.py", line 14, in handler     return handle(event, main)   File "/opt/python/detalib/handler.py", line 32, in handle     return handlers.handle_bare_wsgi(event, main, context)   File "/opt/python/detalib/handlers.py", line 32, in handle_bare_wsgi     return resolve(main.app, event)   File "/opt/python/detalib/adapters/wsgi/__init__.py", line 149, in resolve     result = app(get_environ(event), response.start_response)   File "/opt/python/flask/app.py", line 2548, in __call__     return self.wsgi_app(environ, start_response)   File "/opt/python/flask/app.py", line 2520, in wsgi_app     ctx = self.request_context(environ)   File "/opt/python/flask/app.py", line 2437, in request_context     return RequestContext(self, environ)   File "/opt/python/flask/ctx.py", line 309, in __init__     request = app.request_class(environ)   File "/opt/python/werkzeug/wrappers/request.py", line 115, in __init__     query_string=environ.get("QUERY_STRING", "").encode("latin1"), [2022-09-14T20:16:19+09:00] [ERROR] UnicodeEncodeError: 'latin-1' codec can't encode characters in position 2-4: ordinal not in range(256)

ghost avatar Sep 15 '22 12:09 ghost