mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #46432 from twangboy/win_locales_utf8
Default to UTF-8 for templated files
This commit is contained in:
commit
ac2a6616a7
@ -410,7 +410,14 @@ def render_jinja_tmpl(tmplstr, context, tmplpath=None):
|
||||
decoded_context[key] = value
|
||||
continue
|
||||
|
||||
decoded_context[key] = salt.utils.locales.sdecode(value)
|
||||
try:
|
||||
decoded_context[key] = salt.utils.to_unicode(value, encoding=SLS_ENCODING)
|
||||
except UnicodeDecodeError as ex:
|
||||
log.debug(
|
||||
"Failed to decode using default encoding (%s), trying system encoding",
|
||||
SLS_ENCODING,
|
||||
)
|
||||
decoded_context[key] = salt.utils.locales.sdecode(value)
|
||||
|
||||
try:
|
||||
template = jinja_env.from_string(tmplstr)
|
||||
|
Loading…
Reference in New Issue
Block a user