Skip to content

Commit

Permalink
Handle multibyte values in sample protocol generator
Browse files Browse the repository at this point in the history
* 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
thetamind committed Jul 27, 2012
1 parent c4328a8 commit 77c9594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion topics/mass-insert.md
Expand Up @@ -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
Expand Down

0 comments on commit 77c9594

Please sign in to comment.