Permalink
Browse files

bugfix: get correct size for utf8 strings

  • Loading branch information...
1 parent daa21eb commit 07068d11343e3af517bec39d138653e129d60f6d @schmurfy schmurfy committed Apr 12, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/zip/deflater.rb
  2. +1 −1 lib/zip/pass_thru_compressor.rb
View
@@ -11,7 +11,7 @@ def initialize(outputStream, level = Zlib::DEFAULT_COMPRESSION)
def << (data)
val = data.to_s
@crc = Zlib::crc32(val, @crc)
- @size += val.size
+ @size += val.bytesize
@outputStream << @zlibDeflater.deflate(data)
end
@@ -10,7 +10,7 @@ def initialize(outputStream)
def << (data)
val = data.to_s
@crc = Zlib::crc32(val, @crc)
- @size += val.size
+ @size += val.bytesize
@outputStream << val
end

0 comments on commit 07068d1

Please sign in to comment.