首页 > 其他 > 详细

redis中get值显示为16进制字符串的解决方法

时间:2019-10-12 23:36:08      阅读:415      评论:0      收藏:0      [点我收藏+]

Linux系统中,通过xshell登录redis,当根据某个key进行get取值时,取到的值为“\xc2\xed\xc0\xad\xcb\xb9\xbc\xd3”格式的十六进制字符串,原因是值中的中文以十六进制的格式输出。要解决这个问题,可以在启动Redis客户端如下加入参数:

./redis-cli --raw

参照官方文档:

This time (integer) was omitted from the output since the CLI detected the output was no longer written to the terminal. You can force raw output even on the terminal with the --raw option:

即:加上--raw之后就可以在终端上强制原始输出,也就是将中文输出而不是输出的是一串utf-8编码字符串。

redis中get值显示为16进制字符串的解决方法

原文:https://www.cnblogs.com/zjfjava/p/11664273.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!