[Python-checkins] CVS: python/dist/src/Lib site.py,1.13,1.14
Fredrik Lundh
python-dev@python.org
2000年7月15日 13:45:26 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv3787/Lib
Modified Files:
site.py
Log Message:
-- changed default encoding to "ascii". you can still change
the default via site.py...
Index: site.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** site.py 2000年07月10日 19:32:19 1.13
--- site.py 2000年07月15日 20:45:23 1.14
***************
*** 124,148 ****
# encoding used by the default locale of this system. If the default
# encoding cannot be determined or is unknown, it defaults to 'ascii'.
! #
! def locale_aware_defaultencoding():
! import locale
! code, encoding = locale.getdefaultlocale()
! if encoding is None:
! encoding = 'ascii'
! try:
! sys.setdefaultencoding(encoding)
! except LookupError:
! sys.setdefaultencoding('ascii')
! if 1:
# Enable to support locale aware default string encodings.
! locale_aware_defaultencoding()
! elif 0:
# Enable to switch off string to Unicode coercion and implicit
# Unicode to string conversion.
! sys.setdefaultencoding('undefined')
! elif 0:
! # Enable to hard-code a site specific default string encoding.
! sys.setdefaultencoding('ascii')
#
--- 124,144 ----
# encoding used by the default locale of this system. If the default
# encoding cannot be determined or is unknown, it defaults to 'ascii'.
!
! encoding = None # default
! if 0:
# Enable to support locale aware default string encodings.
! import locale
! loc = locale.getdefaultlocale()
! if loc[1]:
! encoding = loc[1]
!
! if 0:
# Enable to switch off string to Unicode coercion and implicit
# Unicode to string conversion.
! encoding = "undefined"
!
! if not encoding:
! encoding = "ascii"
#