Closed nuintun closed 6 months ago
function getGB2312Codes(content: string): Uint8Array { const bytes: number[] = []; for (const character of content) { let code = GB2312_MAPPING.get(character); // If not found, push "?". code = code != null ? code : 41919; // Write with big endian. bytes.push((code >> 8) & 0xff, code & 0xff); } return new Uint8Array(bytes); }