diff --git a/ExplorerCreateFile/a2_local_element_file_list.py b/ExplorerCreateFile/a2_local_element_file_list.py index db1ddb1..2f006b7 100644 --- a/ExplorerCreateFile/a2_local_element_file_list.py +++ b/ExplorerCreateFile/a2_local_element_file_list.py @@ -1,3 +1,4 @@ +import a2ahk import a2ctrl from a2qt import QtWidgets from a2element import DrawCtrl, EditCtrl @@ -40,8 +41,9 @@ def __init__(self, *args): ) type_combo = a2combo.A2Combo(self) + type_combo.addItems(a2ahk.ENCODINGS) self.editor.add_data_label_widget( - 'encoding', type_combo, type_combo.setCurrentText, default_value=0, label='Encoding' + 'encoding', type_combo, type_combo.setCurrentIndex, default_value=0, label='Encoding' ) ask_check = QtWidgets.QCheckBox('Ask for file name', self) diff --git a/ExplorerCreateFile/explorer_create_file.ahk b/ExplorerCreateFile/explorer_create_file.ahk index 4dd855c..30dffc2 100644 --- a/ExplorerCreateFile/explorer_create_file.ahk +++ b/ExplorerCreateFile/explorer_create_file.ahk @@ -70,11 +70,14 @@ explorer_create_file_handler(menu_name) { file_path := path_join(explorer_get_path(), file_name) + static ahk_encodings := ["UTF-8", "UTF-8-RAW", "UTF-16", "UTF-16-RAW"] + encoding := ahk_encodings[data["encoding"] + 1] + if FileExist(file_path) { MsgBox, 48, File Already Exists, There is already a file with that name here! } else { content := data["content"] - FileAppend , %content%, %file_path% + FileAppend , %content%, %file_path%, %encoding% Send, F5 sleep 1000