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

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented Oct 2, 2013

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

@mdekstrand mdekstrand commented Oct 2, 2013

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

Loading

@@ -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

@bobthecow bobthecow Oct 3, 2013

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?

Loading

Copy link
Member Author

@ddfreyne ddfreyne Oct 3, 2013

Choose a reason for hiding this comment

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

Nah.

Loading

ddfreyne added a commit that referenced this issue Oct 3, 2013
Allow lowercase environment variables in UTF-8 check
@ddfreyne ddfreyne merged commit 4f1b35c into release-3.6.x Oct 3, 2013
@ddfreyne ddfreyne deleted the bug/case-insensitive-utf-8-check branch Oct 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants