summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/__main__.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py
index 887f8e28..f941299e 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -19,6 +19,7 @@
 import os
 import sys
 import ranger
+import locale
 
 from optparse import OptionParser, SUPPRESS_HELP
 from ranger.ext.openstruct import OpenStruct
@@ -153,14 +154,7 @@ def main():
 		print('ranger requires the python curses module. Aborting.')
 		sys.exit(1)
 
-	# Ensure that a utf8 locale is set.
-	if getdefaultlocale()[1] not in ('utf8', 'UTF-8'):
-		for locale in ('en_US.utf8', 'en_US.UTF-8'):
-			try: setlocale(LC_ALL, locale)
-			except: pass
-			else: break
-		else: setlocale(LC_ALL, '')
-	else: setlocale(LC_ALL, '')
+	locale.setlocale(locale.LC_ALL, '')
 
 	arg = parse_arguments()
 	ranger.arg = arg