diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-05 10:02:36 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-05 10:02:36 +0800 |
commit | 06079b7dfab3e692ea0d2615ede597b59d07a8ae (patch) | |
tree | 7e5a8f519c59e0e7ddf9b61e2836a23bc8f34138 /server/src/utility.lua | |
parent | 223b3096ede0755344b47a527544fa6d54e3e1e3 (diff) | |
download | lua-language-server-06079b7dfab3e692ea0d2615ede597b59d07a8ae.zip |
io.load 过滤utf8bom
Diffstat (limited to 'server/src/utility.lua')
-rw-r--r-- | server/src/utility.lua | 3 |
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 |