Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary data output #21

Closed
venkates opened this issue Feb 1, 2013 · 6 comments
Closed

Binary data output #21

venkates opened this issue Feb 1, 2013 · 6 comments
Assignees

Comments

@venkates
Copy link

venkates commented Feb 1, 2013

Hi, I store binary data as values for my keys. I see multiple bytes are combined into a single unicode character when I use rdb-tools to dump my data in json.

This is what I get when dumping from redis using redis-cli:

redis 127.0.0.1:6381> get "43542948993:Brown Home Improvement"
"\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\x01Y\xcc\x9c\x01"

This is what I get from the rdb-tools dump:
[{
"43542948993:Brown Home Improvement":"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001Y\u031c\u0001"}]

The \xcc\x9c is being combined into \u031c. I am guessing the tools is reading the data as utf-8 and converting it to unicode. Is there a way to preserve the bytes?

@sripathikrishnan
Copy link
Owner

Thanks for reporting this issue. I will investigate later this week and post an update.

@ghost ghost assigned sripathikrishnan Feb 4, 2013
@venkates
Copy link
Author

Thanks for looking into it. Let me know if you need more information from me. Thanks for this useful tool.

@dim
Copy link

dim commented Mar 14, 2013

Any updates?

@sripathikrishnan
Copy link
Owner

I have been a bit busy lately and haven't looked at this issue. I will post an update as soon as I get a chance to look into it.

thanks for the patience!

@venkates
Copy link
Author

Do you have any updates on this? Thanks.

@amotzg
Copy link
Contributor

amotzg commented Feb 19, 2017

@venkates, long time but worthwhile to mention, even for future searches.
With, recently merged, string escape option you can now override utf-8 decoding attempts. Using --escape raw will pass bytes as is, avoiding any decode attempt. It will still be \uXXXX escaped but with raw values.

@oranagra this can be closed now having an optional solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants