AConv
Text conversion between Amiga, Atari, ZX Spectrum, MS-DOS and Windows encodings
- Version
- 2.1.0.18
- System
- Windows, 64-bit
- Source
- github.com/pedromagician/AConv
No installation: unzip anywhere (ideally into a folder on your PATH) and run it from the command line or a batch file.
AConv is a command-line tool that converts text between retro and modern character encodings: Amiga, Atari 8-bit, MS-DOS, Windows and ZX Spectrum. Characters are mapped by dictionaries (.dict), which are plain text files, so you can add your own encodings. If you don’t know the encoding of a text, AConv can detect it. The original concept is by Wolf; I maintain and extend the program.
Features
- Four conversion modes: byte → byte (
b2b), byte → Windows (b2w), Windows → byte (w2b) and Windows → Windows (w2w). - Dictionaries with bytes, Windows strings and escape sequences, including string-to-string mappings (e.g. ZX BasinC
\a→á). A dictionary can be inverted (-invert). - Encoding detection (
-detect): dictionary scoring, text heuristics, n-gram analysis and a penalty for unknown characters. Dictionaries are given by a mask, e.g.dict\*.dict. - Byte dumps in decimal or hex (
-decdump,-hexdump) and a default keymap generator (-generatekeymap). - Input and output can be the clipboard instead of a file.
- Output as ANSI, UTF-8 or UTF-8 with BOM, configurable handling of unknown characters and console logging.
The zip contains dictionaries for the Amiga (CZ, E2, Kamenický, KOI8, Latin 1, Latin 2, PBX, PL2), Atari (CZ, EN), ZX Spectrum and helper conversions (remove diacritics, lower and upper case).
Sublime Text plugin
The second zip is a package for Sublime Text 4 that uses AConv right in the editor: Tools → AConv converts the open file (or just the selection) between Windows and the Amiga, Atari or ZX Spectrum, and adds quick conversions (DEC/HEX/BIN, upper and lower case, removing diacritics). It can also detect the encoding of a file. Conversion profiles are in AConv.cfg.
Usage
rem detect the encoding of a file
AConv.exe -detect -input text.txt -dict dict\*.dict
rem Windows text for the Amiga and back (output in ANSI)
AConv.exe -i story.txt -o story.ami -k dict\amiga_e2.dict -t w2b
AConv.exe -i story.ami -o story.txt -k dict\amiga_e2.dict -t b2w -f ansi
rem file bytes as decimal numbers
AConv.exe -i file.bin -o dump.txt -decdumpDetection lists the encodings from the most likely one:
PC-Latin 2 => score 1090, confidence 0.74
Amiga E2 => score 1082, confidence 0.73
ZX(Win) for BasinC => score 424, confidence 0.29Options
| Switch | Description |
|---|---|
-input, -i | Source file. |
-output, -o | Destination file. Without it, the output is inputFileName.out. |
-inputClipboard, -ic | Read the input from the clipboard instead of a file. |
-outputClipboard, -oc | Write the output to the clipboard instead of a file. |
-keymap, -k | Character map (dictionary) for the conversion. Default: keyMap.dict. |
-type, -t | Conversion type: b2b, b2w, w2b, w2w. |
-invert, -inv | Inverts the character map (mainly for w2w and b2b). |
-format, -f | Output format when converting to Windows: ansi, utf8, bom (UTF-8 with BOM). |
-detect, -d | Detect the encoding of the input file. |
-dict | Dictionaries for detection, a mask is allowed (dict\*.dict). |
-decdump, -dd | Write each input byte as a decimal number. |
-hexdump, -hd | Write each input byte as a hexadecimal number. |
-generatekeymap, -g | Generate a default character map into keyMap.dict. |
-errorlevel, -e | Unknown characters: 2 replace and warn (default), 1 warn only, 0 nothing. |
-errorcharacter, -c | Replacement for unknown characters, default ?. |
-log, -l | Console logging: all, important, errors, silent. |
-help, -h, -? | Help. |