Changeset 3392

Show
Ignore:
Timestamp:
07/10/08 21:29:30 (14 years ago)
Author:
jerome
Message:

Works around chardet being unable to detect user charset in some cases.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/branches/1.26_fixes/pykota/tool.py

    r3188 r3392  
    4646    def detectCharset(text) : 
    4747        """Fakes a charset detection if the chardet module is not installed.""" 
    48         return "ISO-8859-15" 
     48        return "UTF-8" 
    4949else :     
    5050    def detectCharset(text) : 
    5151        """Uses the chardet module to workaround CUPS lying to us.""" 
    52         return chardet.detect(text)["encoding"] 
     52        return chardet.detect(text)["encoding"] or "UTF-8" 
    5353 
    5454from pykota import config, storage, logger