Jelajahi Sumber

fixed charset parsing

Gildas 7 tahun lalu
induk
melakukan
f22dd37f93
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      lib/single-file/single-file-browser.js

+ 1 - 1
lib/single-file/single-file-browser.js

@@ -50,7 +50,7 @@ this.SingleFile = (() => {
 					return "data:base64,";
 					return "data:base64,";
 				}
 				}
 			} else {
 			} else {
-				const matchCharset = contentType.match(/\s*;\s*charset\s*=\s*(.*)(;|$)/i);
+				const matchCharset = contentType.match(/\s*;\s*charset\s*=\s*"?([^";]*)"?(;|$)/i);
 				if (matchCharset && matchCharset[1]) {
 				if (matchCharset && matchCharset[1]) {
 					const charSet = matchCharset[1].toLowerCase();
 					const charSet = matchCharset[1].toLowerCase();
 					if (charSet != "utf-8") {
 					if (charSet != "utf-8") {