home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2362 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  746 b   |  23 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import sys
  5.  
  6. try:
  7.     pyreadline_codepage = sys.stdout.encoding
  8. except AttributeError:
  9.     pyreadline_codepage = 'ascii'
  10.  
  11.  
  12. def ensure_unicode(text):
  13.     if isinstance(text, str):
  14.         return text.decode(pyreadline_codepage, 'replace')
  15.     return text
  16.  
  17.  
  18. def ensure_str(text):
  19.     if isinstance(text, unicode):
  20.         return text.encode(pyreadline_codepage, 'replace')
  21.     return text
  22.  
  23.