Character encoding detector for automatic detection of text encodings using occurrence analysis
84
Build a utility that detects and reports the character encoding of text files.
The utility reads a file as binary data and determines its character encoding.
When the encoding cannot be determined, the utility provides appropriate feedback.
@generates
/**
* Detects the character encoding of a file
* @param filePath - Path to the file to analyze
* @returns The detected encoding name, null if detection fails, or "Unknown"
*/
export function detectFileEncoding(filePath: string): string | null;Provides character encoding detection from binary data.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-chardetdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10