Commit 21f80724 authored by Fredrik Lundh's avatar Fredrik Lundh

-- changed default encoding to "ascii". you can still change

   the default via site.py...
parent 49a8b754
...@@ -123,27 +123,23 @@ del exit ...@@ -123,27 +123,23 @@ del exit
# Set the string encoding used by the Unicode implementation to the # Set the string encoding used by the Unicode implementation to the
# encoding used by the default locale of this system. If the default # encoding used by the default locale of this system. If the default
# encoding cannot be determined or is unknown, it defaults to 'ascii'. # 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: encoding = None # default
if 0:
# Enable to support locale aware default string encodings. # Enable to support locale aware default string encodings.
locale_aware_defaultencoding() import locale
elif 0: loc = locale.getdefaultlocale()
if loc[1]:
encoding = loc[1]
if 0:
# Enable to switch off string to Unicode coercion and implicit # Enable to switch off string to Unicode coercion and implicit
# Unicode to string conversion. # Unicode to string conversion.
sys.setdefaultencoding('undefined') encoding = "undefined"
elif 0:
# Enable to hard-code a site specific default string encoding. if not encoding:
sys.setdefaultencoding('ascii') encoding = "ascii"
# #
# Run custom site specific code, if available. # Run custom site specific code, if available.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment