Set VSCode default to create new ahk files with encoding utf8bom

Scripting and setups with Visual Studio Code (vscode) and AutoHotkey.
BosseW
Posts: 1
Joined: 22 Nov 2021, 10:39

Set VSCode default to create new ahk files with encoding utf8bom

Post by BosseW » 29 Nov 2021, 09:13

I have been trying to get VSCode to create new ahk files with encoding utf8bom (UTF-8 with BOM)

I have found that these VSCode settings in settings.json work:

Code: Select all

{
 "[ahk]": {
    "files.encoding": "utf8bom",
    "files.autoGuessEncoding": false,
  }
}
Note! Both settings are needed. Also,

Code: Select all

 "files.autoGuessEncoding": true
(which is default) does not work

It works both in VSCode user settings and workspace settings (settings.json files)

VSCode version is 1.62.3
VSCode Extension "AutoHotkey Plus Plus v2.8.1"
AutohotKey 1.1.33.10

I posted this topic just to document it here in autoHotkey Board for others to find.

Of course comment's and questions are welcome.

Regards Bosse

Return to “Visual Studio Code”