-
Notifications
You must be signed in to change notification settings - Fork 105
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
Force encoding to UTF-8 when normalizing comp name #182
Conversation
👍 |
👍 |
Add a test? |
@gabebw oh yeah right tests. brb. |
c6f5c75
to
2ecf886
Compare
@gabebw test added. Mind taking another gander? |
@@ -83,7 +83,7 @@ def test_target_groups | |||
private | |||
|
|||
def normalized_company_name | |||
company.gsub(/[^0-9a-z]/i, '').downcase | |||
company.force_encoding('utf-8').gsub(/[^0-9a-z]/i, '').downcase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nitpick, but what if we capitalize UTF-8
? I almost never see it written lowercase, and if Ruby doesn't care I'd prefer uppercase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
da158d6
to
409a832
Compare
The tests pass on my machine as well, even with |
How about changing the commit message: "Force UTF-8 when normalizing company name"? "comp name" reads oddly to me. |
This fixes a crash on non `en_US.UTF-8` systems, or when `LANG` isn't set properly.
409a832
to
e90a857
Compare
Done. Thanks, @gabebw |
This fixes a crash on non
en_US.UTF-8
systemsFixes #171