-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Style/Encoding: false doesn't always work for ruby 2.0 #1289
Comments
@jonas054 Would you look into this? |
OK. |
What happens is that we get an exception from @bbatsov @yujinakayama I have two questions.
BTW, I was able to reproduce the problem in Linux with |
I think it should not.
I'm not completely sure, but in this case I'd prefer handling it in RuboCop.
|
@yujinakayama Thanks! |
[Fix #1289] Use utf-8 as default encoding for inspected files
If you have a ruby file without a
# encoding: utf-8
line, and with a non-ASCII character, rubocop may blow up with "Invalid byte sequence in us-ascii". To make it happen every time, setLC_ALL
toLC_ALL=en_US.US-ASCII
(that's for MacOS Mavericks, exact value may depend on your system).One workaround is to set
LC_ALL
to something likeen_US.UTF-8
(exact value may vary depending on your system). However, since ruby 2.0+ defaults to UTF-8, rubocop should do the same (at least when being run with ruby 2.0+) rather than rely on a system default character set (which turns into the rubyEncoding.default_external
which is what rubocop seems to currently be getting when reading files).The text was updated successfully, but these errors were encountered: