-
Notifications
You must be signed in to change notification settings - Fork 431
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
Support chinese or others non-ascii language #86
Comments
Ok, thanks for bringing this up! What's the |
That function gets deleted in normal operation with the intent being that only |
I'm still a little confused why From the docs, "This is useful if you have edited the module source file using an external editor and want to try out the new version without leaving the Python interpreter." That's not something grip is doing. |
The Python runtime imports When you run (When it was implemented, |
Thanks for the explanation. So it seems like there's an underlying issue when it comes to Unicode filenames. Is there another way to address the problem without the global side-effects? Using |
The proper way to handle filename encoding portably is to use Also, As I understand it, |
Awesome, thank you for clarifying. So as I understand it now, the fix would be to use unicode OS functions for names coming into Python, and encode the names interfacing with the filesystem with |
That would fix file handling but you'd still risk "error while attempting to report error" situations if a traceback or error handler attempts to output strings containing non-ASCII characters. That's why a lot of Python 2.x code uses (Basically, replicating Python 3.x behaviour. In Py3x, the default is UTF-8 and |
Ok. Makes sense. @ssokolow Would adding the following to def main(argv=None, force_utf8=True):
"""The entry point of the application."""
if force_utf8 and sys.version_info.major == 2:
reload(sys)
sys.setdefaultencoding('utf-8')
... |
That looks like it should work. |
add
before https://github.com/joeyespo/grip/blob/master/grip/server.py#L11
to support chinese file name
The text was updated successfully, but these errors were encountered: