Search code examples
bashscalaencodingredis

Redis Syntax error with arabic characters


In Redis version 3.2.3 I am getting an error when trying to set:

    set test اتلات بين حماس  ح
    (error) ERR syntax error

I will be accessing Redis from Scala and from bash. So a common encoding is needed. But the main problem is that it fails by itself in a simple Redis command in the cli.

PS: tested using redis-cli --raw did not work.


Solution

  • You need to add quotes because you have spaces in your string, it is not related to the character encoding:

    > set test "اتلات بين حماس ح"
    OK
    > get test
    "اتلات بين حماس ح"