Changeset 3020
- Timestamp:
- 09/19/06 00:52:34 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r3019 r3020 141 141 gettext.NullTranslations().install() 142 142 143 # We can force the charset. 144 # The CHARSET environment variable is set by CUPS when printing. 145 # Else we use the current locale's one. 146 # If nothing is set, we use ISO-8859-15 widely used in western Europe. 147 self.localecharset = None 148 try : 143 # Finds the correct charset 144 self.localecharset = sys.getfilesystemencoding() 145 if self.localecharset is None : 149 146 try : 150 self.localecharset = locale.nl_langinfo(locale.CODESET)151 except AttributeError :152 147 try : 153 148 self.localecharset = locale.getpreferredencoding() … … 158 153 except ValueError : 159 154 pass # Unknown locale, strange... 160 except locale.Error :161 pass162 self.charset = charset or self.localecharset or " ISO-8859-15"155 except locale.Error : 156 pass 157 self.charset = charset or self.localecharset or "UTF-8" 163 158 164 159 # pykota specific stuff