mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-24 00:50:44 +00:00
fix: allow explicit MobaXterm import encoding
This commit is contained in:
1 parent
e3510f8a50
commit
d1b8d97c0c
10 files changed
+139
-6
No files matched your search
@@ -48,3 +48,12 @@ test("readTextFile keeps valid UTF-8 when a fallback encoding is configured", as
|
||||
"[Bookmarks]\n中文服务器",
|
||||
);
|
||||
});
|
||||
|
||||
test("readTextFile honors an explicit encoding for ambiguous bytes", async () => {
|
||||
const file = new File([new Uint8Array([0xc2, 0xa1])], "MobaXterm.ini", {
|
||||
type: "text/plain",
|
||||
});
|
||||
|
||||
assert.equal(await readTextFile(file, { encoding: "utf-8" }), "¡");
|
||||
assert.equal(await readTextFile(file, { encoding: "gb18030" }), "隆");
|
||||
});
|
||||
Reference in new issue
Block a user