Details

    • Number of attachments :
      0

      Description

      jruby --1.9 -S irb

      >> "".match( /\w/)[0]
      => "\xC3\xBC"

      Dunno what to do here[*], but this is not correct.

      [*] in MRI 1.9 \w only matches ascii per default . Would make more sense to use the default encoding for strings when deciding on what to use in regexps imo.

        Activity

        Hide
        Thomas E Enebo added a comment -

        Can you please verify whether this only affects you in irb (JRUBY-5156)? We recently fixed an issue with readline library where it was not properly encoding the strings it was reading. If you put this in a file with the desired encoding you get an expected result?

        Show
        Thomas E Enebo added a comment - Can you please verify whether this only affects you in irb ( JRUBY-5156 )? We recently fixed an issue with readline library where it was not properly encoding the strings it was reading. If you put this in a file with the desired encoding you get an expected result?
        Hide
        Linus Sellberg added a comment - - edited

        cat test.rb

        1. encoding: UTF-8

        x = ""

        p x.match(/\w/)
        jruby --1.9 -S test.rb
        #<MatchData "\xC3\xB6">

        EDIT: where do the 1. come from?!?

        Show
        Linus Sellberg added a comment - - edited cat test.rb encoding: UTF-8 x = "" p x.match(/\w/) jruby --1.9 -S test.rb #<MatchData "\xC3\xB6"> EDIT: where do the 1. come from?!?
        Hide
        Thomas E Enebo added a comment -

        I suspect you used RC2 as a test and not generated a development build. This test case seems to generate an invalid multibyte char just like 1.9 does now.

        (the 1. came from using

        #

        without using a noformat block)

        Show
        Thomas E Enebo added a comment - I suspect you used RC2 as a test and not generated a development build. This test case seems to generate an invalid multibyte char just like 1.9 does now. (the 1. came from using # without using a noformat block)
        Hide
        Diego Plentz added a comment -

        I think we can close this since both jruby and mri have the exact same behavior.

        Show
        Diego Plentz added a comment - I think we can close this since both jruby and mri have the exact same behavior.
        Hide
        Hiro Asari added a comment -

        JRuby's behavior matches that of MRI.

        Show
        Hiro Asari added a comment - JRuby's behavior matches that of MRI.

          People

          • Assignee:
            Hiro Asari
            Reporter:
            Linus Sellberg
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: