-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the SILKY_JSON_ENSURE_ASCII configuration item to support Chinese #420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a new tests which sets this settings to false?
I'm sorry, but as a python novice, I don't really know how to add this feature. Also, I don't have time to do this right now, but it works fine on my project |
Feel free to do it when you have time. Use this decorator to override settings for a test. https://docs.djangoproject.com/en/dev/topics/testing/tools/#overriding-settings |
@@ -28,7 +28,8 @@ class SilkyConfig(metaclass=Singleton): | |||
'SILKY_PYTHON_PROFILER': False, | |||
'SILKY_PYTHON_PROFILER_FUNC': None, | |||
'SILKY_STORAGE_CLASS': 'silk.storage.ProfilerResultStorage', | |||
'SILKY_MIDDLEWARE_CLASS': 'silk.middleware.SilkyMiddleware' | |||
'SILKY_MIDDLEWARE_CLASS': 'silk.middleware.SilkyMiddleware', | |||
'SILKY_JSON_ENSURE_ASCII': True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chinese don't work as Unicode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chinese don't work as Unicode?
The Chinese characters are shown below on the page:
"\u8be5\u8f66\u5728\u3010\u53e4\u853a\u5b8f\u6c38\u3011\u68c0\u6d4b\u672a\u5b8c\u6210\uff0c\u65e0\u6cd5\u767b\u5f55"
Not easy to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you encoded your chinease as utf-8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you encoded your chinease as utf-8?
Yes, the http request send with utf-8 encode
Support for users to configure the
SILKY_JSON_ENSURE_ASCII
parameter to implementjson.dumps
support Chinese