This project is archived and is in readonly mode.

#6386 ✓resolved
David Phillips

ActiveSupport::Gzip.compress returns invalid UTF-8 strings

Reported by David Phillips | February 8th, 2011 @ 01:25 AM

ActiveSuport::Gzip.compress returns strings encoded as UTF-8:

    ruby-1.9.2-p136 :001 > ActiveSupport::Gzip.compress('').encoding
     => #<Encoding:UTF-8>

But they aren't actually UTF-8 strings:

    ruby-1.9.2-p136 :002 > ActiveSupport::Gzip.compress('').blank?
    ArgumentError: invalid byte sequence in UTF-8

Should the encoding be forced to ASCII-8BIT?

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages