Skip to content

Commit f076e64

Browse files
authored
fix: temp svn fs changed output content type to Buffer to preserve encoding-specific characters (#836)
1 parent 5fcedeb commit f076e64

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/temp_svn_fs.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,12 @@ class TempSvnFs implements FileSystemProvider, Disposable {
200200
const hash = crypto.createHash("md5");
201201
const filePathHash = hash.update(svnUri.path).digest("hex");
202202
const encoding = configuration.get<string>("default.encoding");
203+
let contentBuffer: Buffer;
203204

204205
if (encoding) {
205-
content = iconv.encode(content, encoding).toString();
206+
contentBuffer = iconv.encode(content, encoding);
207+
} else {
208+
contentBuffer = Buffer.from(content);
206209
}
207210

208211
if (!this._root.entries.has(filePathHash)) {
@@ -211,7 +214,7 @@ class TempSvnFs implements FileSystemProvider, Disposable {
211214

212215
const uri = Uri.parse(`tempsvnfs:/${filePathHash}/${fname}`, true);
213216

214-
this.writeFile(uri, Buffer.from(content), {
217+
this.writeFile(uri, contentBuffer, {
215218
create: true,
216219
overwrite: true
217220
});

0 commit comments

Comments
 (0)