donglao6169 2017-10-24 09:43
浏览 90
已采纳

Aerospike Charset UTF8设置

I am inserting a record in aerospike. Everything is working fine on my local environment. However, on the staging environment, UTF-8 characters are not being stored correctly.

aql> select msg from test.msges

LIST('["{"message_id":"kxwFZHVBKj","title":"คำถามได้รับà¸à¸²à¸£à¸•à¸­à¸šà¸à¸¥à¸±à¸šà¹à¸¥à¹‰à¸§!","actions": | +----------------------------------------------------------------------------------------------------------+ 1 row in set (0.038 secs)

Also, this is being done using a golang clinet which is pretty UTF-8 safe i.e. no problems of byte-to-string or string-to-byte conversions and this works fine on local, hence I am assuming this has something to do with aerospike configuration or version. The aerospike version on my local is 3.14.1.1 and on staging is 3.9.1.1.

One more thing I noticed based on the c-client comments coming on this post is that on my local machine I get the following aql version:

Aerospike Query Client Version 3.13.0.1 C Client Version 4.1.6

But on the remote I have the following:

Aerospike Query Client Version 3.9.1.2

The C-client version is missing !

Anyone can help what configuration (or whatever) am I missing here ?

  • 写回答

1条回答 默认 最新

  • dongqiang8058 2017-10-25 01:27
    关注

    aql is a tool written in c-client. In c-client, the application is expected to handle utf-8 encoding as there is no "string" datatype similar to newer generation languages that support multibyte utf-8 characters. The application reading data should have prior knowledge that the data is indeed written with utf-8 encoding to handle that. aql cannot determine that as it is a generic tool. So, it ends up printing each byte as a character.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大