docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a command-line tool that analyzes text files and reports their character encoding along with alternative possibilities ranked by confidence.
Your tool should accept a file path as input and produce a detailed analysis report showing:
The tool should handle both small and large files efficiently.
/**
* Analyzes a file and returns encoding analysis results
*/
export interface EncodingMatch {
name: string;
confidence: number;
language?: string;
}
export interface AnalysisResult {
primary: string | null;
alternatives: EncodingMatch[];
}
export function analyzeFile(filepath: string): Promise<AnalysisResult>;Character encoding detection library that provides statistical analysis of text encodings.