mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-17 17:31:31 +00:00
nmcli: use get_best_parsable_locale() to support UTF-8 connection names (#11742)
* nmcli: start locale fix - normalize run_command environ to LANGUAGE=C, LC_ALL=C Work in progress - issue #10384 (UTF-8 conn_name support) requires deeper investigation beyond simple locale variable normalization. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * nmcli: use get_best_parsable_locale() to support UTF-8 connection names Fixes issue where UTF-8 connection names (e.g. Chinese characters) were corrupted to '????' when LC_ALL=C forced ASCII encoding, causing connection_exists() to always return False for non-ASCII names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * add changelog fragment for PR #11742 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e59888dd7e
commit
bdd3174563
3 changed files with 12 additions and 1 deletions
|
|
@ -1705,6 +1705,7 @@ RETURN = r"""#
|
|||
import re
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.locale import get_best_parsable_locale
|
||||
from ansible.module_utils.common.text.converters import to_text
|
||||
|
||||
|
||||
|
|
@ -2915,7 +2916,8 @@ def create_module() -> AnsibleModule:
|
|||
],
|
||||
supports_check_mode=True,
|
||||
)
|
||||
module.run_command_environ_update = dict(LANG="C", LC_ALL="C", LC_MESSAGES="C", LC_CTYPE="C")
|
||||
locale = get_best_parsable_locale(module)
|
||||
module.run_command_environ_update = dict(LANGUAGE=locale, LC_ALL=locale)
|
||||
return module
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue