use getpreferredencoding() instead of getdefaultlocale() to get LOCALE_ENCODING, default to cp1252 if it comes back with US-ASCII (Mac)

This commit is contained in:
Eric Blade 2010-01-28 20:29:43 -05:00
parent 725fb04bb8
commit e29491c25c

View File

@ -138,7 +138,11 @@ DATABASE_TYPES = (
DATABASE_TYPE_MYSQL,
)
LOCALE_ENCODING = locale.getdefaultlocale()[1]
#LOCALE_ENCODING = locale.getdefaultlocale()[1]
LOCALE_ENCODING = locale.getpreferredencoding()
if LOCALE_ENCODING == "US-ASCII":
print "Default encoding set to US-ASCII, defaulting to CP1252 instead -- If you're not on a Mac, please report this problem."
LOCALE_ENCODING = "cp1252"
########################################################################
def string_to_bool(string, default=True):