diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
index 532654f..bfc07ea 100644
a
|
b
|
def get_system_username():
|
82 | 82 | username could not be determined. |
83 | 83 | """ |
84 | 84 | try: |
85 | | return getpass.getuser().decode(locale.getdefaultlocale()[1]) |
| 85 | encoding = locale.getdefaultlocale()[1] or 'UTF8' |
| 86 | return getpass.getuser().decode(encoding) |
86 | 87 | except (ImportError, KeyError, UnicodeDecodeError): |
87 | 88 | # KeyError will be raised by os.getpwuid() (called by getuser()) |
88 | 89 | # if there is no corresponding entry in the /etc/passwd file |