Permalink
Browse files

Count number of bytes, not unicode codepoints.

Closes gh-4.
  • Loading branch information...
1 parent 7c69d64 commit e80c5da7b9f924fe6ab7c62be27124ca89e47732 @kr committed Oct 7, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/beanstalk-client/connection.rb
View
4 lib/beanstalk-client/connection.rb
@@ -53,8 +53,8 @@ def put(body, pri=65536, delay=0, ttr=120)
pri = pri.to_i
delay = delay.to_i
ttr = ttr.to_i
- body = "#{body}" # Make sure that body.size gives a useful number
- interact("put #{pri} #{delay} #{ttr} #{body.size}\r\n#{body}\r\n",
+ body = "#{body}" # Make sure that body.bytesize gives a useful number
+ interact("put #{pri} #{delay} #{ttr} #{body.bytesize}\r\n#{body}\r\n",
%w(INSERTED BURIED))[0].to_i
end

0 comments on commit e80c5da

Please sign in to comment.