Redis中get值中文显示为\xe4\xbd\xa0\xe5\xa5\xbd的16进制字符串怎么解决

场景:
在服务器上redis-cli其他(线上)服务器中redis值时,遇到了这个问题,百度一下,果然有前人采坑,果断收录一下_

在启动Redis客户端如下加入参数输入可解决:

[root@hadoop7 redis]# ./bin/redis-cli --raw

这里要注意–raw有两个“-”号

为什么在后面加上–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编码字符串。


本文来自 Tritoooooy 的CSDN 博客

猜你喜欢

转载自blog.csdn.net/hacker_Lees/article/details/82878897