Skip to content

Commit 7891bd1

Browse files
committed
fix #752
1 parent 55a7ae6 commit 7891bd1

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

Diff for: changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 2.4.6
44
* `FIX` [#744](https://github.com/sumneko/lua-language-server/issues/744)
55
* `FIX` [#748](https://github.com/sumneko/lua-language-server/issues/748)
6+
* `FIX` [#752](https://github.com/sumneko/lua-language-server/issues/752)
67

78
## 2.4.5
89
`2021-10-18`
File renamed without changes.

Diff for: script/files.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ local util = require 'utility'
1010
local guide = require 'parser.guide'
1111
local smerger = require 'string-merger'
1212
local progress = require "progress"
13-
local encoding = require 'encoding'
13+
local encoder = require 'encoder'
1414

1515
---@class files
1616
local m = {}
@@ -141,7 +141,7 @@ function m.setText(uri, text, isTrust, instance)
141141
end
142142
if not isTrust then
143143
if config.get 'Lua.runtime.fileEncoding' == 'ansi' then
144-
text = encoding.ansi2utf8(text)
144+
text = encoder.ansi2utf8(text)
145145
end
146146
end
147147
if file.originText == text then

Diff for: script/library.lua

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ local define = require "proto.define"
1010
local files = require 'files'
1111
local await = require 'await'
1212
local timer = require 'timer'
13+
local encoder = require 'encoder'
1314

1415
local m = {}
1516

@@ -235,6 +236,9 @@ local function initBuiltIn()
235236
local metaDoc = compileSingleMetaDoc(fsu.loadFile(libPath), metaLang, status)
236237
if metaDoc then
237238
local outPath = metaPath / libName
239+
if encoding == 'ansi' then
240+
metaDoc = encoder.utf82ansi(metaDoc)
241+
end
238242
out:saveFile(libName, metaDoc)
239243
m.metaPaths[#m.metaPaths+1] = outPath:string()
240244
end

0 commit comments

Comments
 (0)