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

相關文章
相關標籤/搜索