1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Jeremy Kemper 2009-11-01 10:34:16 +01:00
parent 13004c37e6
commit 36121d29a5

View file

@ -102,7 +102,13 @@ class MultibyteCharsUTF8BehaviourTest < Test::Unit::TestCase
# NEWLINE, SPACE, EM SPACE # NEWLINE, SPACE, EM SPACE
@whitespace = "\n#{[32, 8195].pack('U*')}" @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') @byte_order_mark = [65279].pack('U')
end end