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.

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

报告相同问题?

悬赏问题

  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)