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

Redis-clojure assumes bytes = characters, which isn't necessarily true #10

Open
jwr opened this issue Jun 14, 2010 · 2 comments
Open

Redis-clojure assumes bytes = characters, which isn't necessarily true #10

jwr opened this issue Jun 14, 2010 · 2 comments
Labels

Comments

@jwr
Copy link
Contributor

jwr commented Jun 14, 2010

Redis-clojure uses the counts reported by Redis as character counts, while Redis specs clearly say they are byte counts.

The correct way to go about this is probably to go through java.nio.charset.Charset/defaultCharset.

Right now redis-clojure isn't safe for non-ASCII data.

@ragnard
Copy link
Owner

ragnard commented Jun 14, 2010

Thanks for the report. I'm aware of this and it is fixed in the new version for Clojure 1.2 that I'm working on. I will take a look at a fix for this version.

@jwr
Copy link
Contributor Author

jwr commented Jun 14, 2010

Great! Actually, the problem exists even in the code I just submitted to you (multi-bulk commands), but it is easy to fix there, it's enough to use (count (.getBytes arg)) instead of (count arg).

I looked at the other places, but I don't know enough about Java I/O to fix the input issues.

I would really appreciate a fix for the current version.

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

No branches or pull requests

2 participants