Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/\s/ doesn't match NBSP in Windows-1252 encoded strings #4241

Open
pointlessone opened this issue Oct 22, 2016 · 0 comments
Open

/\s/ doesn't match NBSP in Windows-1252 encoded strings #4241

pointlessone opened this issue Oct 22, 2016 · 0 comments

Comments

@pointlessone
Copy link

Environment

  • JRuby 9.1.5.0, no flags
  • macOS 10.12.1 developer beta

Expected Behavior

In MRI /\s/ matches NBSP (no-break space) in Windows-1252 encoded strings. In JRuby it does not.

MRI:

"\xA0".force_encoding(Encoding::Windows_1252) =~ /\s/
# => 0

Actual Behavior

JRuby:

"\xA0".force_encoding(Encoding::Windows_1252) =~ /\s/
# => nil

Note though that in MRI it doesn't match NBSP in UTF-8 encoded strings:

"\u00A0" =~ /\s/
# => nil

In this case JRuby behaves the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant