Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.1
-
Fix Version/s: JRuby 1.6.7
-
Component/s: Application Error
-
Labels:None
-
Environment:Mac os x 10.6.7
-
Testcase included:yes
-
Number of attachments :
Description
A JRuby internal NegativeArraySizeExcetpion is thrown when trying to strip certain characters from a string. The following test reproduces the error:
# -*- encoding : utf-8 -*-
require 'active_support/core_ext'
require 'test/unit'
class String
def strip_noise()
return if empty?
self.force_encoding('utf-8').mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').to_s().strip()
end
end
class StringTests < Test::Unit::TestCase
def test_strip_illegal_chars()
assert_equal("", " \xC2\xA0".strip_noise())
end
end
Reproduced with jruby-1_6 branch. Investigating.