(ct: string | null)
| 4 | * 从 Content-Type header 中解析 charset |
| 5 | */ |
| 6 | export 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 | |
| 12 | export const decodeUTF32 = (utf32Bytes: Uint8Array, isLE: boolean = true): string => { |
| 13 | if (!(utf32Bytes instanceof Uint8Array)) { |
no outgoing calls
no test coverage detected