diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-07-24 12:05:56 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-07-24 12:05:56 +0900 |
commit | b80cacbb045361c206afb904f0aad8d96f7bd060 (patch) | |
tree | 554e30141c8b55767a1450449c80f1a58ebf4876 /lib/plum/binary_string.rb | |
parent | 561fd0ebb696deb0edcd07d0261cd078c4d14e77 (diff) | |
download | plum-b80cacbb045361c206afb904f0aad8d96f7bd060.tar.gz |
use String#bytesize instead of String#size
Diffstat (limited to 'lib/plum/binary_string.rb')
-rw-r--r-- | lib/plum/binary_string.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/plum/binary_string.rb b/lib/plum/binary_string.rb index ef7733a..8011ea6 100644 --- a/lib/plum/binary_string.rb +++ b/lib/plum/binary_string.rb @@ -37,7 +37,11 @@ module Plum alias push << def shift(count) - slice!(0, count) + enc = self.encoding + force_encoding(Encoding::BINARY) + out = slice!(0, count) + force_encoding(enc) + out end end end |