Can you support Chinese?

Feedback for Q Insight Pad usage

Can you support Chinese?

Postby wjm3120 » Sat Dec 12, 2015 11:42 am

Can it support Chinese?If it can how to set?
wjm3120
 
Posts: 4
Joined: Sat Dec 12, 2015 11:30 am

Re: Can you support Chinese?

Postby Oleg » Sun Dec 13, 2015 6:35 pm

deja-vu?
viewtopic.php?f=2&t=656&hilit=chinese

:) what are you trying to do that isn't working?
Oleg
Site Admin
 
Posts: 56
Joined: Fri Jan 14, 2011 5:10 pm

Re: Can you support Chinese?

Postby wjm3120 » Tue Dec 15, 2015 3:39 am

Tried, it doesn't work, also messy code.
wjm3120
 
Posts: 4
Joined: Sat Dec 12, 2015 11:30 am

Re: Can you support Chinese?

Postby wjm3120 » Tue Dec 15, 2015 3:45 am

Can increase the setting, support unicode?
wjm3120
 
Posts: 4
Joined: Sat Dec 12, 2015 11:30 am

Re: Can you support Chinese?

Postby Oleg » Wed Dec 16, 2015 5:11 pm

test:"什么是你遇到的问题?"
test

results in


! Server changed to `::61

q) test:"什么是你遇到的问题?"
(Roundtrip: 015ms)
::

q) test
(Roundtrip: 016ms)
"什么是你遇到的问题?"


What am I missing?
As far as I understood that's the way q supports unicode
http://code.kx.com/wiki/Cookbook/Unicode

Only problem I'm having with reproducing examples mentioned is from my console in windows not supporting chinese
but you can check unicode notation for bananas in reference example - exactly the same being executed from qpad.

Cheers,
Oleg
Oleg
Site Admin
 
Posts: 56
Joined: Fri Jan 14, 2011 5:10 pm

Re: Can you support Chinese?

Postby wjm3120 » Thu Dec 17, 2015 2:24 am

q) a:"你好";
(Roundtrip: 000ms)
::

q) a
(Roundtrip: 000ms)
"你好"

this is no problem.but...
q) thp3
20151207 ����ת֤ȯ .000 0 .00 .00 .00 .00 .00 0.000 .00 10.00 10.00 0 0 094CF078

q) show thp3
(Roundtrip: 015ms)
::
no problem in the console
s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s..
-----------------------------------------------------------------------------..
20151207 银行转证券 .000 0 .00 .00 .00 .00 ...
wjm3120
 
Posts: 4
Joined: Sat Dec 12, 2015 11:30 am

Re: Can you support Chinese?

Postby _Oz_ » Thu Dec 17, 2015 1:19 pm

Ah, could be problem with encoding which is used in your table, qpad only supports utf8, sorry.
Have you tried studio for kdb+ or qStudio, maybe they are able to handle this?

Cheers,
Oleg
_Oz_
 
Posts: 19
Joined: Sat Feb 05, 2011 3:31 pm

Re: Can you support Chinese?

Postby Flying » Thu Jul 07, 2016 7:24 am

I think the problem is with the RichEdit widget that allows us to edit q code.

The attachment below demonstrates the problem that Chinese users are observing with QPad. Note that the top half is the code editor, which is a RichEdit widget -- text in this window is shown with GBK encoding, though the source code was written in UTF8. The bottom half is the Output widget, which does show Chinese characters properly with UTF8 encoding.

Clipboard01.png
Screen shot that demonstrates the problem with Chinese characters.
Clipboard01.png (18.58 KiB) Viewed 5167 times


EDIT: I'm attaching a second screen shot here. This second screen shot shows the dialog pop up when I attempted to save a q script to disk (the script contains Chinese characters). Note that no matter I answer Yes or No in the dialog, the result is not desirable (Yes, and my script will not be direct load in q; No, and I will lose all my Chinese characters in the script).

Clipboard02.png
Clipboard02.png (3.86 KiB) Viewed 5166 times

END EDIT

In short, the support for Chinese characters is still broken in QPad, especially in the code editor (our q project scripts are all written in UTF8, and all our q database interactions are in UTF8). This is so far the biggest road block for us to consider QPad our top choice in kdb+ development.
Flying
 
Posts: 4
Joined: Thu Jul 07, 2016 7:13 am

Re: Can you support Chinese?

Postby Oleg » Fri Jul 08, 2016 5:15 pm

Hi, Flying!

Thanks a lot for writing detailed report of the problem you're experiencing
I'll try to think of a way to hack around yet another limitation richedit is imposing here... (for the 100th time I'm regretting my choice of richedit control for the source pane)
If you'll have some ideas as to what can be done here or most desirable outcome, let me know @ zakharovoleg@gmail.com
(Maybe I need to reliably distinct between UTF-8/ANSI content of files without BOM, then I can probably fool Richedit on file loading, like I'm doing it on saving)

Cheers,
Oleg
Oleg
Site Admin
 
Posts: 56
Joined: Fri Jan 14, 2011 5:10 pm

Re: Can you support Chinese?

Postby Flying » Thu Jul 14, 2016 5:10 am

Hi, Oleg

You probably won't need to worry about distinguishing ANSI vs UTF-8, IMHO, since UTF-8 is supposed to be downward-compatible with ANSI. That is, you can safely load/display/edit/save an ANSI script using UTF-8 encoding -- that's how q treats all script files after all.

As in how to make RichEdit show UTF-8 contents properly, however, I must admit I have no idea. (I'm more a Linux guy with only very limited Windows programming experience...) I'll try to scout around for some hints. Hope I can find some lead later on...

====EDIT====

Just flashing of some idea... Would it work if we do not use file loading/saving mechanism built into RichEdit? Instead, we can use the .Text value in RichEdit to set/get the script contents, and write the file I/O routines ourselves so as to bypass the RichEdit quirks? Furthermore, encoding conversion logic can be hook into the I/O logic in this way, again, bypassing the part the RichEdit fails to accomplish.

====END====

Thanks again for your great contribution with QPad!

Cheers,
Flying
Flying
 
Posts: 4
Joined: Thu Jul 07, 2016 7:13 am

Next

Return to Feedback

Who is online

Users browsing this forum: No registered users and 1 guest

cron