Changeset 3173 for pykota

Show
Ignore:
Timestamp:
04/23/07 14:11:57 (18 years ago)
Author:
jerome
Message:

Dirty hack of the day (year ?).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r3136 r3173  
    140140        except locale.Error :     
    141141            self.charset = sys.getfilesystemencoding() 
     142         
     143        # Dirty hack : if the charset is ASCII, we can safely use UTF-8 instead 
     144        # This has the advantage of allowing transparent support for recent 
     145        # versions of CUPS which (en-)force charset to UTF-8 when printing. 
     146        # This should be needed only when printing, but is probably (?) safe 
     147        # to do when using interactive commands. 
     148        if self.charset.upper() in ('ASCII', 'ANSI_X3.4-1968') : 
     149            self.charset = "UTF-8" 
    142150         
    143151        # translation stuff