We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01ee045 commit 402a7e7Copy full SHA for 402a7e7
arduino-ide-extension/src/browser/create/create-fs-provider.ts
@@ -154,7 +154,9 @@ export class CreateFsProvider
154
155
async readFile(uri: URI): Promise<Uint8Array> {
156
const content = await this.getCreateApi.readFile(uri.path.toString());
157
- return new TextEncoder().encode(content);
+ // Text encoder can crash in electron browser: https://github.com/arduino/arduino-ide/issues/634#issuecomment-1440039171
158
+ // Credit for the workaround: https://stackoverflow.com/a/45722000/5529090
159
+ return Uint8Array.from(content, (char) => char.charCodeAt(0));
160
}
161
162
async writeFile(
0 commit comments