summaryrefslogtreecommitdiff
path: root/xmake/plugins/lua
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-02-02 09:19:04 +0300
committerSaikari <[email protected]>2026-02-02 09:19:04 +0300
commit077e2daa5a10dbd9e20a9f25bad74bb303678c66 (patch)
tree34d0b9a27c326b75966062ab1599fe2ffe509922 /xmake/plugins/lua
parenta172936c31bd2ef1cb7711e68ca584c9e951f487 (diff)
refactor: replace hardcoded utf8 BOM check with utf8.bom constant for improved maintainability
Diffstat (limited to 'xmake/plugins/lua')
-rw-r--r--xmake/plugins/lua/main.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/plugins/lua/main.lua b/xmake/plugins/lua/main.lua
index 7137ea589..f5f7a6867 100644
--- a/xmake/plugins/lua/main.lua
+++ b/xmake/plugins/lua/main.lua
@@ -64,8 +64,8 @@ function main()
local script_content = io.read("*a")
if script_content then
-- remove utf8 bom
- if script_content:startswith("\239\187\191") then
- script_content = script_content:sub(4)
+ if script_content:startswith(utf8.bom) then
+ script_content = script_content:ltrim(utf8.bom)
end
local shell = os.shell()
if shell == "cmd" or shell == "powershell" or shell == "pwsh" or is_host("windows") then