encoding-handler — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited encoding-handler (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Handle text encoding across platforms.
import { Buffer } from 'buffer';
import iconv from 'iconv-lite';
export function detectBOM(buffer: Buffer): string | null {
if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) return 'utf-8';
if (buffer[0] === 0xFF && buffer[1] === 0xFE) return 'utf-16le';
if (buffer[0] === 0xFE && buffer[1] === 0xFF) return 'utf-16be';
return null;
}
export function stripBOM(content: string): string {
return content.charCodeAt(0) === 0xFEFF ? content.slice(1) : content;
}
export function decodeBuffer(buffer: Buffer, encoding = 'utf-8'): string {
const bom = detectBOM(buffer);
if (bom) {
return stripBOM(iconv.decode(buffer, bom));
}
return iconv.decode(buffer, encoding);
}
export function encodeString(content: string, encoding = 'utf-8', addBOM = false): Buffer {
const encoded = iconv.encode(content, encoding);
if (addBOM && encoding.toLowerCase() === 'utf-8') {
return Buffer.concat([Buffer.from([0xEF, 0xBB, 0xBF]), encoded]);
}
return encoded;
}~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.