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
invalid byte sequence
error when escaping utf-8 characters in a regexp character range
#10902
Comments
invalid byte sequence
error when having utf-8 characters in regexp using /u
invalid byte sequence
error when having utf-8 characters in regexp
It also fails with
|
It does not fail with
|
It does not fail with
So the problem is escaping the utf-8 character inside a character range. |
It also occurs in the newest rubocop 1.34.1 |
invalid byte sequence
error when having utf-8 characters in regexpinvalid byte sequence
error when escaping utf-8 characters in a regexp character range
…ring with invalid byte sequence in UTF-8 Fixed: rubocop#10902
…th invalid byte sequence in UTF-8 Fixed: #10902
Given file
bar.rb
containingRunning
rubocop -d bar.rb
will fail with aninvalid byte sequence in UTF-8
error.It is related to escaping the utf-8 character inside a character range, because
and
works fine
Expected behavior
If it is an error on my part, it should tell me what the error is like any other lint cop.
If not, it should generate an error.
Actual behavior
Describe here what actually happened.
Steps to reproduce the problem
Given file
bar.rb
containingRunning
rubocop -d bar.rb
will fail with aninvalid byte sequence in UTF-8
error.RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:The text was updated successfully, but these errors were encountered: