Issue Type: Bug Bug
Affects Versions: JRuby 1.7.4
Assignee: Unassigned
Components: Encoding
Created: 01/Aug/13 8:37 AM
Description:

I have been trying to get Rails Tests to pass on JRuby & have ran into this issue related to encoding.

Problem:
JRuby is defaulting back to US-ASCII encoding when it should be using UTF-8

Steps to reproduce:
1. git clone https://github.com/rails/rails.git
2. bundle install
3. cd activesupport
4. jruby -w -Ilib:test -Ku test/inflector_test.rb

Expected Result:
Minitest should report Errors/Failed TestCases.

What Actually Happens:
JRuby is defaulting back to US-ASCII encoding when clearly we are specifying UTF via

a) magic comment.
b) command line arugment

As a result Testrun doesn't complete & following Stracktrace is thrown:

ArgumentError: invalid byte sequence in US-ASCII
=== at org/jruby/RubyRegexp.java:1492
each at org/jruby/RubyArray.java:1617
grep at org/jruby/RubyEnumerable.java:489
methods_matching at /home/gaurish/.rvm/gems/jruby-1.7.4@rails-master/gems/minitest-5.0.6/lib/minitest.rb:244
runnable_methods at /home/gaurish/.rvm/gems/jruby-1.7.4@rails-master/gems/minitest-5.0.6/lib/minitest/test.rb:63
run at /home/gaurish/.rvm/gems/jruby-1.7.4@rails-master/gems/minitest-5.0.6/lib/minitest.rb:262
__run at /home/gaurish/code/repo/rails/activesupport/lib/active_support/test_case.rb:31
map at org/jruby/RubyArray.java:2417
__run at /home/gaurish/code/repo/rails/activesupport/lib/active_support/test_case.rb:30
run at /home/gaurish/.rvm/gems/jruby-1.7.4@rails-master/gems/minitest-5.0.6/lib/minitest.rb:113
autorun at /home/gaurish/.rvm/gems/jruby-1.7.4@rails-master/gems/minitest-5.0.6/lib/minitest.rb:46

No such error occurs on MRI & it correctly uses UTF-8 encoding. If we remove Non-ascii chars(https://github.com/rails/rails/blob/master/activesupport/test/inflector_test_cases.rb) from this file, the test work on JRUBY as well.

so I am wondering if this a bug with JRUBY or just the test is wrong?

Environment: JRUBY 1.7.4 on java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) Server VM (build 23.25-b01, mixed mode)
Ubuntu 12.04 LTS


LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Project: JRuby
Priority: Major Major
Reporter: Gaurish Sharma
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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