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

Allow lowercase environment variables in UTF-8 check #338

Merged
merged 2 commits into from Oct 3, 2013

Conversation

denisdefreyne
Copy link
Member

This makes the nanoc CLI recognise UTF-8 support in the terminal as available when LC_ALL, LC_CTYPE or LANG contain the lowercase utf instead of only the uppercase UTF.

Fixes #335.

@mdekstrand
Copy link

I'm not a Ruby programmer, but this looks like it will fix it. 👍

@@ -184,7 +184,7 @@ def self.setup_cleaning_streams
def self.enable_utf8?(io)
return true if !io.tty?

%w( LC_ALL LC_CTYPE LANG ).any? { |e| ENV[e] =~ /UTF/ }
%w( LC_ALL LC_CTYPE LANG ).any? { |e| ENV[e] =~ /UTF/i }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have to worry about utf16 and other dumb things like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah.

denisdefreyne added a commit that referenced this pull request Oct 3, 2013
Allow lowercase environment variables in UTF-8 check
@denisdefreyne denisdefreyne merged commit 4f1b35c into release-3.6.x Oct 3, 2013
@denisdefreyne denisdefreyne deleted the bug/case-insensitive-utf-8-check branch October 3, 2013 07:59
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.

None yet

3 participants