I am using https://github.com/KxSystems/kdb/blob/master/c/c.js for connecting HTML 5 websocket to KdB+ backend. I am facing an issue while sending Chinese characters from the backend. HTML charset is set for UTF-8 but still displays mess code rathan than correct characters. Same result when I print it in the web browser console. Dose c.js support UTF-8? How can I display Unicode characters correctly sent by KDB+ in the browser?
Asked
Active
Viewed 391 times
1 Answers
1
As of 2016.03.18, c.js should support (de)serialization of UTF8. The version here has the functions to do so.
More information on unicode charsets in kdb+ can be found here.

Thomas Smyth - Treliant
- 4,993
- 6
- 25
- 36

Paul Kerrigan
- 465
- 5
- 12
in HTML js: var query = {func:"test",arg1:"你好"}; ws.send(serialize(query)); in kdb+ q)test:{show x} q)"\344\275\240\345\245\275" q)`char$"你好" "\304\343\272\303"
As you can see "\344\275\240\345\245\275" is different from "\304\343\272\303". It looks like c.js uses a different method of (de)serialization of UTF8 from kdb+ dose. – Rongshu Apr 24 '17 at 02:15