We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c6c41ed commit ce14627Copy full SHA for ce14627
1 file changed
src/vs/workbench/services/textfile/common/encoding.ts
@@ -242,11 +242,7 @@ async function guessEncodingByBuffer(buffer: VSBuffer): Promise<string | null> {
242
// https://github.com/aadsm/jschardet/blob/v2.1.1/src/index.js#L36-L40
243
const binaryString = encodeLatin1(limitedBuffer.buffer);
244
245
- // override type since jschardet expects Buffer even though can accept string
246
- // can be fixed once https://github.com/aadsm/jschardet/pull/58 is merged
247
- const jschardetTypingsWorkaround = binaryString as any;
248
-
249
- const guessed = jschardet.detect(jschardetTypingsWorkaround);
+ const guessed = jschardet.detect(binaryString);
250
if (!guessed || !guessed.encoding) {
251
return null;
252
}
0 commit comments