Skip to content
Browse files

Ruby 1.9 doesn't recognize EM SPACE as whitespace, breaking String#strip

  • Loading branch information...
1 parent d988507 commit 9ea850027c1677979b4d2ac96481ddf523a88303 @jeremy jeremy committed Nov 1, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 activesupport/test/multibyte_chars_test.rb
View
8 activesupport/test/multibyte_chars_test.rb
@@ -103,7 +103,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

0 comments on commit 9ea8500

Please sign in to comment.
Something went wrong with that request. Please try again.