diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb index 680936ded5fadfc5c6ee63f414b6b10ea09d766e..0d3c3c771684fdb79c8a07f2fd6e522841756719 100644 --- a/activesupport/test/multibyte_chars_test.rb +++ b/activesupport/test/multibyte_chars_test.rb @@ -102,7 +102,13 @@ def setup # NEWLINE, SPACE, EM SPACE @whitespace = "\n#{[32, 8195].pack('U*')}" - @whitespace.force_encoding(Encoding::UTF_8) if @whitespace.respond_to?(:force_encoding) + + # Ruby 1.9 doesn't recognize EM SPACE as whitespace! + if @whitespace.respond_to?(:force_encoding) + @whitespace.slice!(2) + @whitespace.force_encoding(Encoding::UTF_8) + end + @byte_order_mark = [65279].pack('U') end