The following example works in MRI Ruby 1.9.3/2.0.0,
but gives java.lang.ArrayIndexOutOfBoundsException on JRuby 1.7.15.
This issue may be related to JRUBY-6860.
https://jira.codehaus.org/browse/JRUBY-6860
Example
# encoding: utf-8
("Ã1#" * 15).slice(43, 43)
My environment
jruby 1.7.15 (1.9.3p392) 2014-09-03 82b5cc3 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_05-b13 +jit [darwin-x86_64]