Fails to use UTF-8 encoded source with BOM.
-------------------------------------------

                 Key: JRUBY-5742
                 URL: http://jira.codehaus.org/browse/JRUBY-5742
             Project: JRuby
          Issue Type: Bug
          Components: Application Error
    Affects Versions: JRuby 1.6.1
         Environment: Windows 7 x64, Oracle Java 1.6.0_21 x86, JRuby 1.6.1 x86
            Reporter: Maxim Sokolovskij


When trying to start UTF-8-BOM encoded file on JRuby 1.6.1:
{code:title=1.rb}
puts 'test'
{code}
{code:title=2.rb}
# encoding: utf-8
puts 'test'
{code}
{code}
C:\aXe1\dev\ruby\test\jruby>jruby -v
jruby 1.6.1 (ruby-1.9.2-p136) (2011-04-12 85838f6) (Java HotSpot(TM) Client VM 1
.6.0_21) [Windows 7-x86-java]

C:\aXe1\dev\ruby\test\jruby>jruby 1.rb
SyntaxError: 1.rb:1: \273Invalid char `\273' ('╗') in expression

C:\aXe1\dev\ruby\test\jruby>jruby 2.rb
SyntaxError: 2.rb:1: \273Invalid char `\273' ('╗') in expression
{code}
So it fails on BOM,regardless on magic 'encoding' comment. On MRI Ruby 
1.9.2p180 it works fine:
{code}
C:\aXe1\dev\ruby\test\jruby>ruby -v
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

C:\aXe1\dev\ruby\test\jruby>ruby 1.rb
test

C:\aXe1\dev\ruby\test\jruby>ruby 2.rb
test
{code}

-- 
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