summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-05 10:02:36 +0800
committersumneko <sumneko@hotmail.com>2019-05-05 10:02:36 +0800
commit06079b7dfab3e692ea0d2615ede597b59d07a8ae (patch)
tree7e5a8f519c59e0e7ddf9b61e2836a23bc8f34138 /server/src
parent223b3096ede0755344b47a527544fa6d54e3e1e3 (diff)
downloadlua-language-server-06079b7dfab3e692ea0d2615ede597b59d07a8ae.zip
io.load 过滤utf8bom
Diffstat (limited to 'server/src')
-rw-r--r--server/src/utility.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/src/utility.lua b/server/src/utility.lua
index 5ff02b8b..b908bdc7 100644
--- a/server/src/utility.lua
+++ b/server/src/utility.lua
@@ -208,6 +208,9 @@ function io.load(file_path)
if not f then
return nil, e
end
+ if f:read(3) ~= '\xEF\xBB\xBF' then
+ f:seek("set")
+ end
local buf = f:read 'a'
f:close()
return buf