Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle multibyte values in sample protocol generator

* Length needs to be number of bytes not number of characters
* Fixes 'RR Protocol error: expected '$', got ' error
* Ruby 1.8.7+ compatible
  • Loading branch information...
commit 77c9594e628cee76b3b6ed1618f7b11c104578f6 1 parent c4328a8
@thetamind thetamind authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  topics/mass-insert.md
View
2  topics/mass-insert.md
@@ -99,7 +99,7 @@ The following Ruby function generates valid protocol:
proto = ""
proto << "*"+cmd.length.to_s+"\r\n"
cmd.each{|arg|
- proto << "$"+arg.length.to_s+"\r\n"
+ proto << "$"+arg.to_s.bytesize.to_s+"\r\n"
proto << arg.to_s+"\r\n"
}
proto
Please sign in to comment.
Something went wrong with that request. Please try again.