MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / parseCharsetFromContentType

Function parseCharsetFromContentType

src/pkg/utils/encoding.ts:6–10  ·  view source on GitHub ↗
(ct: string | null)

Source from the content-addressed store, hash-verified

4 * 从 Content-Type header 中解析 charset
5 */
6export const parseCharsetFromContentType = (ct: string | null): string => {
7 if (!ct) return "";
8 const m = /charset\s*=\s*["']?([^"';\s]+)/i.exec(ct);
9 return m ? m[1].toLowerCase() : "";
10};
11
12export const decodeUTF32 = (utf32Bytes: Uint8Array, isLE: boolean = true): string => {
13 if (!(utf32Bytes instanceof Uint8Array)) {

Callers 2

encoding.test.tsFile · 0.90
readRawContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected