Update to qPython 2.0 and add support for utf-8#28
Update to qPython 2.0 and add support for utf-8#28komsit37 merged 1 commit intokomsit37:masterfrom atf1206:update_qpython
Conversation
|
This is awesome. I have tested it a bit and all looks good to me so far. I think the change should be ok since most of it is just upgrading qPython. So, let me know if you are happy with this then I can merge it. Regarding A) yes, that's how kdb's B) Where do you see this warning? I can't find it in the console. |
|
I think it is good as-is. Seems to be close to what you see at the REPL, including: re: B) It is not a big problem, and in fact I do not expect you to see the error since your machine likely supports en_GB.UTF-8 whereas mine does not. That's why I was suggesting to just let it default to the user's setting. But let's make it a separate PR for the future. |
|
Great, I have merged it! |
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_stringto 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 setlocalelocale.Error: unsupported locale settingI 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.