Closed atf1206 closed 4 years ago
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 .Q.s
does it. I don't work with non-English so it's not a problem for me. But I imagine it would be helpful if you can display it correctly in sublime text. We can do this in a separate PR if needed.
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:
q)`$"ééé"
`ééé
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_string
to support properly encoding strings to send to kdb. Check out the PR against the qPython repo here: https://github.com/exxeleron/qPython/pull/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 bemyLocale=locale.setlocale(category=locale.LC_ALL)
but have not included that change here.