We have some redis Hash keys which are storing values as c++ structures and for that we have used binary safe mode. Example:
redisReply* reply = (redisReply*)redisCommand(ctxt, "HMSET %b %b %b", KEY.c_str(), strlen(KEY.c_str()), &val,
sizeof(KEY), &temp_element, sizeof(temp_element));
keys looks like this in redis DB:
- "\x14\x10"
- "KEY_dc8d8afe8e2a_301_0.4116_ECpriReceptionMonitor\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
Where KEY is integer value and temp_element is a structure.
But when we try to take dump using redisdl module as show below:
db_dump=redisdl.dumps(db=db_instance,pretty=True)
it gives below error:
'utf-8' codec can't decode byte 0x90 in position 1: invalid start byte
we tried with encoding='iso-8859-1' seems to work but how to check if this is the correct encoding format?
Br, Neeraj