sripathikrishnan/redis-rdb-tools — pull request #39 by jorgeuriarte (2014-01-17 11:56:44+00:00)
Title: Hacking to allow handling of utf-8 encoded data

Hi there; first of all, thanks for your work and for opening it. It saved my day.

That said, I've got into some troubles with data encoded inside redid. Some of my utf-8 encoded strings in my dumps were causing the parser to crash, when doing things like:

rdb --command protocol --key "ru_RU" dump.rdb

the change in callbacks.py is to allow those utf-8 data strings to be parsed. Without that change, I was facing

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128)

every time the parser ran into a utf-8 char (á, é, ñ...)

The change in rdb.py avoids a crash that happened only when launching in some consoles, and piping the output out to a file.

The fix are probably not good enough to be pulled, but I just thought they might be of help to avoid others will crash against the same wall I did.

Thanks!