mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-09 16:01:28 +00:00
Default to UTF-8 encoding when locale doesn't specify one (as Python defaults
to ascii); thanks Stefano Rivera.
This commit is contained in:
parent
0aaa0f1f4a
commit
a41422a7f4
@ -177,6 +177,7 @@ def ubu_email(name=None, email=None, export=True):
|
|||||||
|
|
||||||
# decode env var or gecos raw string with the current locale's encoding
|
# decode env var or gecos raw string with the current locale's encoding
|
||||||
encoding = locale.getdefaultlocale()[1]
|
encoding = locale.getdefaultlocale()[1]
|
||||||
if encoding:
|
if not encoding:
|
||||||
name = name.decode(encoding)
|
encoding = 'utf-8'
|
||||||
|
name = name.decode(encoding)
|
||||||
return name, email
|
return name, email
|
||||||
|
Loading…
x
Reference in New Issue
Block a user