Accents stored in Redis not being readable

前端 未结 4 2124
清酒与你
清酒与你 2020-12-06 00:35

Working with Redis 2.10 using redis-cli on Linux, I am faced with a problem regarding accents...

If I execute the command

set \"string\" \"à\

相关标签:
4条回答
  • 2020-12-06 01:11

    You need to spec the version of Redis and more importantly the client you are using.

    If you are using a telnet client, the problem may be your client. Redis supports arbitrary bytes for values and UTF-8 is not a problem at all (if your client is properly converting the entered glyphs to the associated byte sequence.)

    0 讨论(0)
  • 2020-12-06 01:13

    Try using

    redis-cli --raw
    

    It solved problem for me.

    0 讨论(0)
  • 2020-12-06 01:17

    "\xc3\xa0" is just Unicode "à" in UTF-8 encoding. Just decode the string and you're done...

    0 讨论(0)
  • 2020-12-06 01:32

    "you string".encode("utf-8") when you need get the string "you string".decode("utf-8")

    0 讨论(0)
提交回复
热议问题