1. 程式人生 > >Redis中get值中文顯示為\xe4\xbd\xa0\xe5\xa5\xbd的16進位制字串怎麼解決

Redis中get值中文顯示為\xe4\xbd\xa0\xe5\xa5\xbd的16進位制字串怎麼解決

場景:
在伺服器上redis-cli其他(線上)伺服器中redis值時,遇到了這個問題,百度一下,果然有前人採坑,果斷收錄一下_

在啟動Redis客戶端如下加入引數輸入可解決:

[[email protected] 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 部落格