Permalink
Browse files

Fix #2137 -- capitalize UTF-8 properly in locale guessing

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information...
1 parent 885ce80 commit 9545ee3cae1e84b913a5000c9afb046f41d7f696 @Kwpolska Kwpolska committed Oct 8, 2015
Showing with 13 additions and 2 deletions.
  1. +11 −0 CHANGES.txt
  2. +2 −2 nikola/nikola.py
View
@@ -1,3 +1,14 @@
+New in master
+=============
+
+Features
+--------
+
+Bugfixes
+--------
+
+* Capitalize "UTF-8" properly in locale guessing (Issue #2137)
+
New in v7.7.2
=============
View
@@ -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)
@@ -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]))

0 comments on commit 9545ee3

Please sign in to comment.