From d4bde372966581c3d81aed9df64bc0d733a6f89b Mon Sep 17 00:00:00 2001 From: Ben Letchford Date: Mon, 24 Feb 2020 19:36:13 +1100 Subject: [PATCH] Check for extended ASCII characters for plaintext files (#234) --- src/client/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/index.ts b/src/client/index.ts index 432fd7a..41c0522 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -101,7 +101,7 @@ socket.on('connect', () => { } // Check if the buffer is ASCII // Ref: https://stackoverflow.com/a/14313213 - else if (/^[\x00-\x7F]*$/.test(fileCharacters)) { // eslint-disable-line no-control-regex + else if (/^[\x00-\xFF]*$/.test(fileCharacters)) { // eslint-disable-line no-control-regex mimeType = 'text/plain'; fileExt = 'txt'; }