aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/gzip.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/gzip.rb')
-rw-r--r--activesupport/lib/active_support/gzip.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/gzip.rb b/activesupport/lib/active_support/gzip.rb
index 35a50e9a77..62f9c9aa2e 100644
--- a/activesupport/lib/active_support/gzip.rb
+++ b/activesupport/lib/active_support/gzip.rb
@@ -5,6 +5,10 @@ module ActiveSupport
# A convenient wrapper for the zlib standard library that allows compression/decompression of strings with gzip.
module Gzip
class Stream < StringIO
+ def initialize(*)
+ super
+ set_encoding "BINARY" if "".encoding_aware?
+ end
def close; rewind; end
end
@@ -22,4 +26,4 @@ module ActiveSupport
output.string
end
end
-end \ No newline at end of file
+end