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

Add support for lower- or mixed-cased values on environment variables #3

Closed
wants to merge 1 commit into from
Closed

Conversation

Darkhogg
Copy link
Contributor

In my current Linux installation (Manjaro, installed two years ago) the variable LANG reports a value of en_US.utf8, with that exact case. This made this package detect my system as not supporting UTF-8 and therefore some applications (particularly npm) don't use their nicer display modes. This pull request addresses this by making all checks case-agnostic.

It also includes tests for lowercase strings, and I've added a missing test for the LC_CTYPE variable, which was missing.

This addresses #2

@gagern
Copy link
Contributor

gagern commented Jan 22, 2016

I found out that the code doesn't handle overrides (like LC_ALL=C overriding LANG=en_US.UTF-8) correctly. Instead of creating a pull request which would conflict with yours, I decided to create an independent pull request which addresses both these issues. Feel free to comment on #4. The core regex there is the same you have, though.

@iarna
Copy link
Owner

iarna commented Jun 23, 2016

Thanks for putting this together, I've landed it in 2.0.1.

@iarna iarna closed this Jun 23, 2016
iarna added a commit to npm/npm that referenced this pull request Jun 24, 2016
Fix unicode dection on a number of Linux distributions.

Credit: @Darkhogg
Credit: @gagern
Reviewed-By: @iarna
PR-URL: iarna/has-unicode#3
PR-URL: iarna/has-unicode#4
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

Successfully merging this pull request may close these issues.

3 participants