Details

    • Type: Bug Bug
    • Status: Reopened Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: JRuby 1.5.3
    • Fix Version/s: JRuby 1.6
    • Component/s: Windows
    • Labels:
      None
    • Environment:
      Mac OS X 10.6 / openSUSE 11.3
    • Number of attachments :
      5

      Description

      In irb of CRuby 1.9, String#encoding returns valid encodings, UTF-8.

      But in 1.9 mode irb of JRuby, String#encoding returns invalid encodings, ASCII-8BIT.

      Please see the attached screenshots because description area can't diaplay Japanese.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Thank you for the update. We will try to solve this once and for all for 1.7.

        Show
        Charles Oliver Nutter added a comment - Thank you for the update. We will try to solve this once and for all for 1.7.
        Hide
        Jan Kotlar added a comment - - edited

        Hello,
        i have trouble with UTF-8 encoded file scripts. It is working with magic comment but if i want run it withou it i have syntax error. I tried it with jruby 1.6.7.2 and also wiht new 1.7.0.preview1. I use windows 7 operationg system.
        Here is my test script(string is in czech):

        a = "Přli luťoučk kůň"
        puts a
        puts a.encoding
        

        and if i run this console command:

        jruby -Ku --1.9 test_encoding.rb
        

        i got Syntax error:

        SyntaxError: test_encoding.rb:1: invalid multibyte char (US-ASCII)
        

        i thing -Ku parameter should be exactly for setting file encoding but it doesn't work.
        jruby and OS version i tryed:

        jruby 1.7.0.preview1 (ruby-1.9.3-p203) (2012-05-19 00c8c98) (Java HotSpot(TM) Client VM 1.6.0_31) [Windows 7-x86-java]
        and
        jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (Java HotSpot(TM) Client VM 1.6.0_31) [Windows 7-x86-java]
        

        Thanks for help.

        Show
        Jan Kotlar added a comment - - edited Hello, i have trouble with UTF-8 encoded file scripts. It is working with magic comment but if i want run it withou it i have syntax error. I tried it with jruby 1.6.7.2 and also wiht new 1.7.0.preview1. I use windows 7 operationg system. Here is my test script(string is in czech): a = "Přli luťoučk kůň" puts a puts a.encoding and if i run this console command: jruby -Ku --1.9 test_encoding.rb i got Syntax error: SyntaxError: test_encoding.rb:1: invalid multibyte char (US-ASCII) i thing -Ku parameter should be exactly for setting file encoding but it doesn't work. jruby and OS version i tryed: jruby 1.7.0.preview1 (ruby-1.9.3-p203) (2012-05-19 00c8c98) (Java HotSpot(TM) Client VM 1.6.0_31) [Windows 7-x86-java] and jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (Java HotSpot(TM) Client VM 1.6.0_31) [Windows 7-x86-java] Thanks for help.
        Show
        Youhei Kondou added a comment - - edited In jirb and jirb_swing on 1.7.0 RC1 and RC2, http://jira.codehaus.org/browse/JRUBY-5156?focusedCommentId=299233&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-299233 still occurs.
        Hide
        Thomas E Enebo added a comment -

        Can you run this and tell me your result:

        jruby -e 'require "java"; puts java.lang.System.getProperty("file.encoding")'
        

        Also does your input charset match this value? Does your input charset match default_external in Ruby?

        I am assuming that your default_external is not matching file.encoding system property. I even have a comment about this being a problem in readline source code.

        Show
        Thomas E Enebo added a comment - Can you run this and tell me your result: jruby -e 'require "java"; puts java.lang.System.getProperty("file.encoding")' Also does your input charset match this value? Does your input charset match default_external in Ruby? I am assuming that your default_external is not matching file.encoding system property. I even have a comment about this being a problem in readline source code.
        Hide
        Youhei Kondou added a comment -

        Yes, these two are different.

        > jruby -e "require 'java'; puts java.lang.System.getProperty('file.encoding')"
        MS932
        > jruby -e "puts Encoding.default_external"
        Windows-31J

        But, these two indicate same codepoints.

        Show
        Youhei Kondou added a comment - Yes, these two are different. > jruby -e "require 'java'; puts java.lang.System.getProperty('file.encoding')" MS932 > jruby -e "puts Encoding.default_external" Windows-31J But, these two indicate same codepoints.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Youhei Kondou
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: