Update to qPython 2.0 and add support for utf-8 #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change is focused on updating to qPython 2.0. All code changes below should just be either:
encoding = 'UTF-8'
to the qconnection init; and_write_string
to support properly encoding strings to send to kdb. Check out the PR against the qPython repo here: Correctly calculate message length based on encoded length exxeleron/qPython#77Although this is hopefully straightforward, I recommend testing it for a while before merging since it is such a core part of sublime-q.
Also, a couple things that are NOT changed (yet?):
A. Did not change decoding of the strings in sublime-q, so if you send "õ" you get back "\303\265" (this is how kdb does it, but we could parse it back to "õ" if we wanted).
B. I noticed a small warning,
myLocale=locale.setlocale(category=locale.LC_ALL, locale="en_GB.UTF-8");
File "./python3.3/locale.py", line 573, in setlocale
locale.Error: unsupported locale setting
I believe that since locale is an optional arg, it should just be
myLocale=locale.setlocale(category=locale.LC_ALL)
but have not included that change here.