MCPcopy Index your code
hub / github.com/hoothin/UserScripts / extractCharsetFromContentType

Function extractCharsetFromContentType

Pagetual/pagetual.user.js:4188–4192  ·  view source on GitHub ↗
(contentType)

Source from the content-addressed store, hash-verified

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 = [];

Callers 1

requestWithFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected