Command-line utility to convert ANSI-encoded files to UTF-8 with a BOM (Byte Order Mark).
No installation required. Just download AnsiToUtf8.exe and run it from the command line.
AnsiToUtf8 <file_mask> [codepage]
where:
file_mask— file name or mask of files to convert, e.g.source.pasor*.pas.codepage— source ANSI code page. Defaults to 1251.
Examples:
AnsiToUtf8 source.pas
AnsiToUtf8 *.pas
AnsiToUtf8 Source\*.pas 1252- Converts a single file or multiple files matching a mask.
- Adds a UTF-8 BOM (
EF BB BF) to converted files. - Skips files that already have a UTF-8 BOM.
- Creates a
.bakbackup of the original file before conversion.
The utility can also be used in batch files for bulk conversion.