(contentType)
| 4186 | return ""; |
| 4187 | } |
| 4188 | function extractCharsetFromContentType(contentType) { |
| 4189 | if (!contentType || typeof contentType !== "string") return ""; |
| 4190 | let match = contentType.match(/charset\s*=\s*["']?([^;"'\s]+)/i); |
| 4191 | return match && match[1] ? match[1].trim() : ""; |
| 4192 | } |
| 4193 | function decodeArrayBufferByCharset(buffer, preferredCharset) { |
| 4194 | let bytes = new Uint8Array(buffer); |
| 4195 | let decoderList = []; |