Skip to content

fix: extra BOM write to file#13

Open
Nigh wants to merge 1 commit into
The-CoDingman:mainfrom
Nigh:fix-extra-bom-mark-write-to-file
Open

fix: extra BOM write to file#13
Nigh wants to merge 1 commit into
The-CoDingman:mainfrom
Nigh:fix-extra-bom-mark-write-to-file

Conversation

@Nigh

@Nigh Nigh commented Dec 3, 2025

Copy link
Copy Markdown

In AutoHotkey v2, when opening or creating files using “w” (Write) mode, the default encoding is UTF-8 (with BOM). When you execute FileOpen, AHK silently writes a three-byte BOM at the very beginning of the file. Subsequent RawWrite operations write the correct binary data, but they append it after the BOM.

Explicitly specifying the encoding as “CP0” will completely prevent AHK from automatically writing BOM markers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant