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