IsBOM

Checks the byte order mark for buffer or address.


OutputVar := IsBOM(AddressOrBuffer , BOM)
Function Example: result := IsBOM(&var, "UTF-16BE")

Parameters

OutputVar

The name of the variable to store true if a byte order mark was found at given address or buffer. If no BOM was given and a BOM is found, its name is returned, otherwise CP0 is returned.

AddressOrBuffer

Buffer or address to check for a byte order mark.

BOM (optional)

Byte order mark to check for. This parameter can be UTF-8, UTF-16, UTF-16BE, UTF-32 or UTF-32BE only, otherwise empty string will be returned. If no BOM was given and a BOM is found, its name is returned, otherwise CP0 is returned.

Examples

MsgBox % IsBOM(FileRead(A_ScriptFullPath,"RAW")) ; Get BOM of the script
MsgBox % IsBOM(FileRead(A_ScriptFullPath,"RAW"),"UTF-8") ; Check if script is saved with UTF-8 BOM