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

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

./redis-cli --raw

参照官方文档:shell

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编码字符串。

code

相关文章
相关标签/搜索