JRuby Internal Java NegativeArraySizeExcetpion when normalising a string
------------------------------------------------------------------------

                 Key: JRUBY-5846
                 URL: http://jira.codehaus.org/browse/JRUBY-5846
             Project: JRuby
          Issue Type: Bug
          Components: Application Error
    Affects Versions: JRuby 1.6.1
         Environment: Mac os x 10.6.7
            Reporter: Paul Cowan
         Attachments: jruby_exception.rb

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
  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to