Fix T82292: Set encoding for keymap export to UTF-8
Keymaps have previously been exported with an encoding dependent on the current system locale. This caused issues when the keymap contained non-ASCII characters, for instance in a string property for an operator. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D9449
This commit is contained in:
@@ -164,7 +164,7 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False):
|
|||||||
# not essential, just convenient to order them predictably.
|
# not essential, just convenient to order them predictably.
|
||||||
export_keymaps.sort(key=lambda k: k[0].name)
|
export_keymaps.sort(key=lambda k: k[0].name)
|
||||||
|
|
||||||
with open(filepath, "w") as fh:
|
with open(filepath, "w", encoding="utf-8") as fh:
|
||||||
fw = fh.write
|
fw = fh.write
|
||||||
|
|
||||||
# Use the file version since it includes the sub-version
|
# Use the file version since it includes the sub-version
|
||||||
|
|||||||
Reference in New Issue
Block a user