Skip to content

Improper error encoding in strscan on Windows #7177

@headius

Description

@headius

This is likely coming from deeper in JRuby, like from Regexp logic, but here's a quick script based on the Windows failure from ruby/strscan#25:

require 'strscan'
s = StringScanner.new("foo bar baz")
s.scan(/(?<a>\w+) (?<b>\w+) (\w+)/)
s["\u{30c6 30b9 30c8}"] rescue p $!

On non-Windows platforms, this last line prints #<IndexError: undefined name <テスト> reference> but on Windows the Japanese characters are mangled into undefined name <\u00E3\u0192\u2020\u00E3\u201A\u00B9\u00E3\u0192\u02C6> reference

This is the sole remaining failure for the JRuby strscan support. Note that this is only a different in the error message on Windows; the error itself is firing correctly on all platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions