docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
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.
/**
* 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.