Open huaouo opened 4 years ago
Thanks for reporting.
It seems that when using single quotes or no quote, \x00
will be sent as a string, but in double-quotes then hex value will be interpreted as number 0
.
I tested it with this script:
$ redis-cli -p 7889
127.0.0.1:7889> set 0 "\x00"
OK
127.0.0.1:7889> set 0 '\x00'
OK
127.0.0.1:7889> set 0 \x00
OK
127.0.0.1:7889>
RESP content:
=> $3
=> set
=> $1
=> 0
=> $1
=>
<= +OK
=> *3
=> $3
=> set
=> $1
=> 0
=> $4
=> \x00
<= +OK
=> *3
=> $3
=> set
=> $1
=> 0
=> $4
=> \x00
<= +OK
I am wondering how did you find out about this? I didn't see redis-doc mentioned this anywhere. :)
Results from
redis-cli
:Results from
iredis
: