Pārlūkot izejas kodu

grass.py: fallback to UTF8 if no default encoding found - https://trac.osgeo.org/grass/ticket/2869

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67607 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 9 gadi atpakaļ
vecāks
revīzija
de8d8b2e0b
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      lib/init/grass.py

+ 3 - 0
lib/init/grass.py

@@ -52,6 +52,9 @@ import locale
 # ----+- Python 3 compatibility start -+----
 PY2 = sys.version[0] == '2'
 ENCODING = locale.getdefaultlocale()[1]
+if ENCODING is None:
+    ENCODING = 'UTF-8'
+    print("Default locale not found, using UTF-8")  # intentionally not translatable
 
 
 def to_text_string(obj, encoding=ENCODING):