redis中get值顯示為16進制字符串的解決方法


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編碼字符串。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM