Changeset 1851
- Timestamp:
- 10/20/04 10:12:27 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r1850 r1851 22 22 # 23 23 # $Log$ 24 # Revision 1.134 2004/10/20 08:12:27 jalet 25 # Another fix for charset detection and Python2.3 26 # 24 27 # Revision 1.133 2004/10/19 22:24:00 jalet 25 28 # Should fix the printer's hostname or IP address detection code. … … 542 545 # Else we use the current locale's one. 543 546 # If nothing is set, we use ISO-8859-15 widely used in western Europe. 544 localecharset = locale.getlocale()[1]545 547 try : 546 localecharset = localecharset or locale.getdefaultlocale()[1] 547 except ValueError : 548 pass # Unknown locale, strange... 548 # preferred method with Python 2.3 and up 549 localecharset = locale.getpreferredencoding() 550 except AttributeError : 551 localecharset = locale.getlocale()[1] 552 try : 553 localecharset = localecharset or locale.getdefaultlocale()[1] 554 except ValueError : 555 pass # Unknown locale, strange... 549 556 self.charset = charset or os.environ.get("CHARSET") or localecharset or "ISO-8859-15" 550 557