summaryrefslogtreecommitdiff
path: root/django/utils/encoding.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/encoding.py')
-rw-r--r--django/utils/encoding.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py
index 89eac79dd4..360eb91ed5 100644
--- a/django/utils/encoding.py
+++ b/django/utils/encoding.py
@@ -249,12 +249,12 @@ def filepath_to_uri(path):
def get_system_encoding():
"""
- The encoding of the default system locale. Fallback to 'ascii' if the
+ The encoding for the character type functions. Fallback to 'ascii' if the
#encoding is unsupported by Python or could not be determined. See tickets
#10335 and #5846.
"""
try:
- encoding = locale.getdefaultlocale()[1] or "ascii"
+ encoding = locale.getlocale()[1] or "ascii"
codecs.lookup(encoding)
except Exception:
encoding = "ascii"