The Redis server saves all data as binary objects, so it is independent of the encoding. The server will simply save what is sent by the client (including UTF-8 characters).
Here are some experiments:
$ echo téléphone | hexdump -C 00000000 74 c3 a9 6c c3 a9 70 68 6f 6e 65 0a |t..l..phone.|
c3a9 is a representation of the 'é' char.
$ redis-cli > set t téléphone OK > get t "t\xc3\xa9l\xc3\xa9phone"
Actually, the data is correctly stored on the Redis server. However, when it runs in the terminal, the Redis client interprets the output and uses the sdscatrepr function to convert non-printable characters (the definition of which is language-dependent and can be split into multi-byte characters anyway).
A simple workaround is to run redis-cli with the "raw" option:
$ redis-cli --raw > get t téléphone
Your own application will probably use one of the client libraries, not redis-cli, so in practice this should not be a problem.
source share