aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/multibyte_chars_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-11-01 10:34:16 +0100
committerJeremy Kemper <jeremy@bitsweat.net>2009-11-02 17:50:12 -0800
commit36121d29a53c71cbdf4f0280718d572f16360f8c (patch)
treeeae3a84c7898b9d2cc77191a5d38c699a5e608d3 /activesupport/test/multibyte_chars_test.rb
parent13004c37e658dac960ba3a75cdf90206fc58118e (diff)
downloadrails-36121d29a53c71cbdf4f0280718d572f16360f8c.tar.gz
rails-36121d29a53c71cbdf4f0280718d572f16360f8c.tar.bz2
rails-36121d29a53c71cbdf4f0280718d572f16360f8c.zip
Ruby 1.9 doesn't recognize EM SPACE as whitespace, breaking String#strip
Diffstat (limited to 'activesupport/test/multibyte_chars_test.rb')
-rw-r--r--activesupport/test/multibyte_chars_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/test/multibyte_chars_test.rb b/activesupport/test/multibyte_chars_test.rb
index 680936ded5..0d3c3c7716 100644
--- a/activesupport/test/multibyte_chars_test.rb
+++ b/activesupport/test/multibyte_chars_test.rb
@@ -102,7 +102,13 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
# 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