kdb 字符串转换时如何处理特殊字符

发布于 2025-01-13 11:22:17 字数 315 浏览 1 评论 0原文

当将值转换为字符串时(通过“string”关键字)

 Ex.
 t:([]stuff:`a`b`c)
 select string stuff from t 
 

从 k 函数调用时(通过 C 客户端)在最终 0a 之前添加一个奇怪的特殊字符,

 0x0180

这是什么?处理它的最佳方法是什么?有没有办法得到一个没有这个特殊字符的字符串?

 stuff,more
 a,1.2�
 b,2.3�
 c,3.4�

When casting a value to a string (via "string" keyword)

 Ex.
 t:([]stuff:`a`b`c)
 select string stuff from t 
 

Adds a weird special character before final 0a when calling from k function (via C client)

 0x0180

What is this ? What is best way of handling it ? Is there anyway to get a string without this special character ?

 stuff,more
 a,1.2�
 b,2.3�
 c,3.4�

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故事与诗 2025-01-20 11:22:17

特殊字符不会出现在 aq 会话中

q)select string stuff from t
stuff
-----
,"a"
,"b"
,"c"

,因此人们假设您的问题是由 C API。由于不熟悉 API,其余内容都是推测性的。对不起。

如果您正在使用 API,也许您不需要返回表,只需要列值。 exec 是否更接近您想要的?

q)exec string stuff from t
,"a"
,"b"
,"c"

如果是这样,您还看到您所询问的角色吗?

The special character does not appear in a q session

q)select string stuff from t
stuff
-----
,"a"
,"b"
,"c"

so one supposes your problem arises from the C API. Not being familiar with the API, the rest of this is speculative. Sorry.

If you are working through the API, perhaps you do not need a table returned, only the column values. Is exec perhaps closer to what you want?

q)exec string stuff from t
,"a"
,"b"
,"c"

If so, do you still see the character you ask about?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文