0% found this document useful (0 votes)
131 views

Redis Command Line To View Chinese Without Scrambling

Uploaded by

sdancer75
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views

Redis Command Line To View Chinese Without Scrambling

Uploaded by

sdancer75
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2/5/2021 Redis command line to view Chinese without scrambling (hexadecimal string processing) | Develop Paper

(https://developpaper.com) Navigator

Position: Home (https://developpaper.com) > Blogs (https://developpaper.com/category/blogs/) > DBT


(https://developpaper.com/category/blogs/dbt/) > Redis (https://developpaper.com/category/blogs/dbt/redis/) >
Content

Redis command line to view Chinese without scrambling


(hexadecimal string processing)
Time:2019-7-11

Redis command line to view Chinese without scrambling

When Redis uses command-line operations, if the content is viewed in Chinese, it displays a h
exadecimal string ” xe4 xb8 xad xe5 x9b xbd”

127.0.0.1:6379 > set K1'China'


OK
127.0.0.1:6379> get k1
"\xe4\xb8\xad\xe5\x9b\xbd"

If you want to see Chinese without scrambling, there are two solutions:

I. Use echo

$ echo -e `redis (https://developpaper.com/tag/redis/)-cli get k1`


China

2. After redis-cli, add raw

$ redis-cli --raw
127.0.0.1:6379> get k1
China

Here are some examples of Redis using hexadecimal string processing, as follows:

Redis’s Chinese content is stored in hexadecimal format in the process of using Redis, so wh
en using redis-cli client connection, if the Chinese part of the content is displayed in hexadeci
mal format, it is not convenient to query the data content in redis. In fact, under Unix system, y
ou can put it in the form of hexadecimal. The hexadecimal content is retrieved by using the “-
e” parameter in echo to convert the queried hexadecimal content, as follows:

https://developpaper.com/redis-command-line-to-view-chinese-without-scrambling-hexadecimal-string-processing/ 1/3
2/5/2021 Redis command line to view Chinese without scrambling (hexadecimal string processing) | Develop Paper

127.0.0.1:6379> get test1


"test\xe6\x8c\x81\xe4\xb9\x85\xe5\x8c\x96"
127.0.0.1:6379> quit
[root@localhost ~]# echo -e "test\xe6\x8c\x81\xe4\xb9\x85\xe5\x8c\x96"
Test persistence

In addition, when using the redis-cli client, the’-raw’parameter of the redis-cli client itself can b
e used to output the original content when connecting redis:

[root@localhost ~]# redis-cli --raw


127.0.0.1:6379> get test1
Test persistence

summary

Above is the whole content of this article. I hope that the content of this article has a certain re
ference value for everyone’s study or work. If you have any questions, you can leave a messa
ge and exchange it. Thank you for your support to developpaer.

Tags: Chinese random code (https://developpaper.com/tag/chinese-random-code/), redis


(https://developpaper.com/tag/redis/), Redis Chinese (https://developpaper.com/tag/redis-chinese/), Redis display Chinese
random code (https://developpaper.com/tag/redis-display-chinese-random-code/)

Recommended Today

How to choose pulsar vs Kafka? (https://developpaper.c…


The author is Jesse Anderson. The content is translated and organized by streamnational.Taking three
actual use scenarios as examples, from the perspective of CTO, Kafka and pulsar are compared in
technology and other aspects.It takes about eight minutes to read this article. About Apache pulsar Apache
pulsar is Apache The top project of software foundation […]

Win10 configuration redis service implementation proc… Handling method of redis connection timeout exceptio…

Installation and test of redis on MacOS (https://develo… Use redis to get data and transfer it to JSON to solve t…

Redis solves the key garbled problem and cleans up t… Record of scan command in redis (https://developpap…

Redis cluster solution (https://developpaper.com/redis-… Redis cluster details (https://developpaper.com/redis-c…

The realization method of converting audio files into bi… Detailed analysis on the source code of redis network …

https://developpaper.com/redis-command-line-to-view-chinese-without-scrambling-hexadecimal-string-processing/ 2/3
2/5/2021 Redis command line to view Chinese without scrambling (hexadecimal string processing) | Develop Paper

Pre: Why is it so difficult for Python to find a job even though he is very hot? (https://developpaper.com/why-

Next: Solution of FTP unzip problem in linking Linux to windows (https://developpaper.com/solution-of-ftp-

java (https://developpaper.com/question/tag/java/) Search 


php (https://developpaper.com/question/tag/php/)

python (https://developpaper.com/question/tag/python/)

linux (https://developpaper.com/question/tag/linux/)
windows (https://developpaper.com/question/tag/windows/)

android (https://developpaper.com/question/tag/android/)

ios (https://developpaper.com/question/tag/ios/)

mysql (https://developpaper.com/question/tag/mysql/)

html (https://developpaper.com/question/tag/html/)

.net (https://developpaper.com/question/tag/net/)
github (https://developpaper.com/question/tag/github/)

node.js (https://developpaper.com/question/tag/node-js/)

Copyright © 2019 Develop Paper (https://developpaper.com) All Rights


Reserved (http://www.miibeian.gov.cn/)
Sitemap (https://developpaper.com/sitemap.xml) About DevelopPaper
(https://developpaper.com/about-developpaper/) Privacy Policy
(https://developpaper.com/privacy-policy/) Contact Us
(https://developpaper.com/contact-us/)

https://developpaper.com/redis-command-line-to-view-chinese-without-scrambling-hexadecimal-string-processing/ 3/3

You might also like