This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11071|Reply: 1

[Redis] The issue of redis Chinese cannot be displayed properly

[Copy link]
Posted on 8/29/2018 4:41:09 PM | | | |


As shown in the figure above, run the keys * command, the key value contains Chinese, and then it cannot be displayed directly in Chinese, as shown in the figure above,

In the end, the Internet is coded with "ISO-8859-1", but no relevant official information can be found.

>>> "\xe6\xb2\xaaFN123".encode("iso-8859-1").decode('utf8')
'Shanghai FN123'
Python encoding transformation, as shown in the figure below:



There is also a way to display Chinese directly in the redis client, as follows:

1. Open CMD.exe command line window

2. Change the code page through the chcp command, and the code page of UTF-8 is 65001



After doing this, the code page is turned into UTF-8. However, UTF-8 characters still do not display correctly in the window.

3. Modify window properties and change fonts

Right-click on the command line title bar, select Properties - > Fonts, change the font to the True Type font "Lucida Console", and click OK to apply the properties to the current window. As shown in the following figure:




Finally, add the --raw parameter when the client connects! As shown below:



However, with this method, I can't enter Chinese in the cmd command, so I can't execute the get command!





Previous:c# encapsulates a universal QueueHelper queue
Next:A simple way to clear the screen from the Python command line
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com