Description: correctly handle unset locale
 The program couldn't handle an unset locale and failed to work under such
 circumstances. The minimal patch corrects this behaviour.
 It has been applied upstream, too.
Author: Sebastian Humenda <shumenda@gmx.de>
Last-Update: <2017-03-16>

Index: gladtex/gleetex/document.py
===================================================================
--- gladtex.orig/gleetex/document.py
+++ gladtex/gleetex/document.py
@@ -190,12 +190,14 @@ class LaTeXDocument:
             # try to guess language and hence character set (fontenc)
             import locale
             language = locale.getdefaultlocale()
-            if language: # extract just the language code
+            if language and language[0]: # extract just the language code
                 language = language[0].split('_')[0]
+            if not language or not language[0]:
+                language = 'en'
             # check whether language on computer is within T1 and hence whether
             # it should be loaded; I know that this can be a misleading
             # assumption, but there's no better way that I know of
-            if language in ['fr', 'es', 'it', 'de', 'nl', 'ro']:
+            if language in ['fr', 'es', 'it', 'de', 'nl', 'ro', 'en']:
                 encoding_preamble += '\n\\usepackage[T1]{fontenc}'
             else:
                 raise ValueError(("Language not supported by T1 fontenc "
