Skip to content

Commit

Permalink
Make fs_writefile output utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Oct 25, 2024
1 parent 72fede0 commit c24dfad
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,8 @@ function fs_readfile(p) {
}

function fs_writefile(p, data) {
let u8 = new Uint8Array(data.length);
for (let i = 0; i < data.length; ++i) {
u8[i] = data.charCodeAt(i);
}
let f = std.open(p, "w");
f.write(u8.buffer, 0, u8.length);
f.puts(data); // utf8
f.close();
}

Expand Down

0 comments on commit c24dfad

Please sign in to comment.