This project is archived and is in readonly mode.
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
-
Josh Kalderimis February 9th, 2011 @ 12:07 AM
- Tag set to active_support
- Assigned user set to Santiago Pastorino
Hi David,
I have wrapped up your example into a failing test case and have whipped up a patch to correct the problem. I just need to run it by Santiago before I pop the diff up, which I'll do tomorrow morning.
Thanks,
Josh
-
Repository February 9th, 2011 @ 09:27 AM
- State changed from new to resolved
(from [3eb25fb8806c0b161d2d1d9cb22d0bdfc7b0ce63]) fix for AS Gzip returning a UTF-8 string in Ruby 1.9 when it is actually binary [#6386 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
https://github.com/rails/rails/commit/3eb25fb8806c0b161d2d1d9cb22d0... -
Repository February 9th, 2011 @ 09:28 AM
(from [31690ea8b3420aea4ea4427e1599665d093c974f]) fix for AS Gzip returning a UTF-8 string in Ruby 1.9 when it is actually binary [#6386 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
https://github.com/rails/rails/commit/31690ea8b3420aea4ea4427e15996...
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
Tags
Referenced by
- 6386 ActiveSupport::Gzip.compress returns invalid UTF-8 strings (from [3eb25fb8806c0b161d2d1d9cb22d0bdfc7b0ce63]) fix for...
- 6386 ActiveSupport::Gzip.compress returns invalid UTF-8 strings (from [31690ea8b3420aea4ea4427e1599665d093c974f]) fix for...