Skip to content

Commit

Permalink
fix: Change file encoding & linefeed
Browse files Browse the repository at this point in the history
  • Loading branch information
narze committed Jul 7, 2021
1 parent 0c959cd commit bc673cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ export async function generateKlc(
fs.writeFileSync(
"./output/test.klc",
[
lines.join("\n\n"),
shiftStateLines.join("\n"),
layoutLines.join("\n"),
lines.join("\r\n\r\n"),
shiftStateLines.join("\r\n"),
layoutLines.join("\r\n"),
"ENDKBD",
].join("\n\n"),
].join("\r\n\r\n"),
{
encoding: "utf8",
encoding: "utf16le",
}
)
}
Expand Down
Binary file modified output/test.klc
Binary file not shown.
4 changes: 2 additions & 2 deletions test/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ describe("generateKlc", () => {
expect(fs.existsSync("output/test.klc")).toBeTruthy()

const lines = fs
.readFileSync("output/test.klc", "utf-8")
.split("\n")
.readFileSync("output/test.klc", "utf16le")
.split("\r\n")
.filter(Boolean)

// Assert file headers
Expand Down

0 comments on commit bc673cb

Please sign in to comment.