Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #2137 -- capitalize UTF-8 properly in locale guessing
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Oct 8, 2015
1 parent 885ce80 commit 9545ee3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGES.txt
@@ -1,3 +1,14 @@
New in master
=============

Features
--------

Bugfixes
--------

* Capitalize "UTF-8" properly in locale guessing (Issue #2137)

New in v7.7.2
=============

Expand Down
4 changes: 2 additions & 2 deletions nikola/nikola.py
Expand Up @@ -2254,7 +2254,7 @@ def valid_locale_fallback(desired_locale=None):
"""
# Whenever fallbacks change, adjust test TestHarcodedFallbacksWork
candidates_windows = [str('English'), str('C')]
candidates_posix = [str('en_US.utf8'), str('C')]
candidates_posix = [str('en_US.UTF-8'), str('C')]
candidates = candidates_windows if sys.platform == 'win32' else candidates_posix
if desired_locale:
candidates = list(candidates)
Expand Down Expand Up @@ -2288,7 +2288,7 @@ def guess_locale_from_lang_posix(lang):
locale_n = str(lang)
else:
# this works in Travis when locale support set by Travis suggestion
locale_n = str((locale.normalize(lang).split('.')[0]) + '.utf8')
locale_n = str((locale.normalize(lang).split('.')[0]) + '.UTF-8')
if not is_valid_locale(locale_n):
# http://thread.gmane.org/gmane.comp.web.nikola/337/focus=343
locale_n = str((locale.normalize(lang).split('.')[0]))
Expand Down

0 comments on commit 9545ee3

Please sign in to comment.