0

I want to store the data received from API and store it as a value in Redis.The response would be in different languages eg: I want to store the response ದಿನಾಂಕ .But whenever i try to access the value throug key the response would be something like "\xe0\xb2\xa6\xe0\xb2\xbf\xe0\xb2\xa8\xe0\xb2\xbe\xe0\xb2\x82\xe0\xb2\x95" . Please help if possible :)

1 Answers1

0

That's simply the array of bytes (hexadecimal representation) of your string (UTF-8 representation).

For example, input e0 b2 a6 e0 b2 bf e0 b2 a8 e0 b2 be e0 b2 82 e0 b2 95 in https://onlineutf8tools.com/convert-bytes-to-utf8.

All you should do is use a function (depending on your programming language or Redis client) to convert an array of bytes into its UTF-8 string representation.

See Python-redis keys() returns list of bytes objects instead of strings.

Lior Kogan
  • 19,919
  • 6
  • 53
  • 85