Retrotxtgo
Handle legacy, code page text files in a modern terminal.
Install / Use
/learn @bengarrett/RetrotxtgoREADME
Retrotxt
RetroTxt for the terminal
Read legacy code pages and ANSI-encoded text files in modern Unicode terminals.
Downloads
Numerous downloads are available for:
Windows users can use File Explorer to decompress it.
The Linux and macOS downloads are standalone terminal applications in a gzip compressed binary.
# replace 'foo' with the remainder of the filename
$ gzip -d retrotxt_foo.gz
# after decompression, to confirm the download and version
$ retrotxt -v
macOS users will need to delete the 'quarantine' extended attribute that is applied to all program downloads that are not notarized by Apple for a fee.
$ xattr -d com.apple.quarantine retrotxt
Linux packages:
Homebrew
macOS and Linux users can install via Homebrew:
brew tap bengarrett/retrotxt https://github.com/bengarrett/retrotxtgo
brew install bengarrett/retrotxt/retrotxt
Update to the latest version with:
brew upgrade bengarrett/retrotxt/retrotxt
Quick Usage
Text files and art created before Unicode was widely adopted often fail to display correctly on modern systems.
Use RetroTxt to display legacy text in modern terminals.
$ retrotxt view ascii-logo.txt
██████╗ ███████╗████████╗██████╗ ██████╗ ████████╗██╗ ██╗████████╗
██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗╚══██╔══╝╚██╗██╔╝╚══██╔══╝
██████╔╝█████╗ ██║ ██████╔╝██║ ██║ ██║ ╚███╔╝ ██║
██╔══██╗██╔══╝ ██║ ██╔══██╗██║ ██║ ██║ ██╔██╗ ██║
██║ ██║███████╗ ██║ ██║ ██║╚██████╔╝ ██║ ██╔╝ ██╗ ██║
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
Or save it to a Unicode file and use it in other apps.
$ retrotxt view ascii-logo.txt > ascii-logo-utf8.txt

Otherwise, legacy text is often malformed and unreadable when using most terminal apps.
$ type ascii-logo.txt # or, cat ascii-logo.txt
�����ۻ ������ۻ�������ۻ�����ۻ �����ۻ �������ۻ�ۻ �ۻ�������ۻ
������ۻ������ͼ�������ͼ������ۻ�������ۻ�������ͼ��ۻ��ɼ�������ͼ
������ɼ����ۻ �ۺ ������ɼ�ۺ �ۺ �ۺ ����ɼ �ۺ
������ۻ����ͼ �ۺ ������ۻ�ۺ �ۺ �ۺ ����ۻ �ۺ
�ۺ �ۺ������ۻ �ۺ �ۺ �ۺ�������ɼ �ۺ ��ɼ �ۻ �ۺ
�ͼ �ͼ������ͼ �ͼ �ͼ �ͼ �����ͼ �ͼ �ͼ �ͼ �ͼ
In the real world
Swedish text
$ cat 14670.txt
�mnet d�r, fortfor den andre, r�r till en del de antika gallerna; men
f�r det mesta sker h�ndelserna i andev�rlden.
--I andev�rlden? Ja just. Jag har f�rnummit, redan i Songes, att s�
skall vara. Vad tycker du, Eleonora? Frans, Aurora ... i andev�rlden,
mina barn!
Farv�l, farv�l tills vi r�kas!
End of the Project Gutenberg EBook of Det g�r an, by Carl Jonas Love Almqvist
$ retrotxt 14670.txt --input latin1
Ämnet där, fortfor den andre, rör till en del de antika gallerna; men
för det mesta sker händelserna i andevärlden.
--I andevärlden? Ja just. Jag har förnummit, redan i Songes, att så
skall vara. Vad tycker du, Eleonora? Frans, Aurora ... i andevärlden,
mina barn!
Farväl, farväl tills vi råkas!
End of the Project Gutenberg EBook of Det går an, by Carl Jonas Love Almqvist
Japanese text
$ cat rshmn10j.txt
# no text is displayed as the text isn't ASCII compatible
$ retrotxt rshmn10j.txt --input shiftjis
暫、死んだように倒れていた老婆が、屍骸の中から、その裸の体を起こしたのは、そ
れから間もなくの事である。老婆は、つぶやくような、うめくような声を立てながら、
まだ燃えている火の光をたよりに、梯子の口まで、這って行った。そうして、そこから、
短い白髪を倒(さかさま)にして、門の下を覗きこんだ。外には、唯、黒洞々(こくと
うとう)たる夜があるばかりである。
下人は、既に、雨を冒して、京都の町へ強盗を働きに急いでいた。
Cyrillic text
$ cat olavg10.txt
"������ � ��� ���������, ����� ���,
���� ������� ����, �������
�� ������� ���� � ��������� �����,
����� � � ������� ����������.
��� ����� ����� �� ���� �� ������
���-�������, ���-�������� - ����
�� ��������� �� ������� ���������,
����� �� �� ������� � ��� ���."
*** END OF THE PROJECT GUTENBERG EBOOK, OLAF VAN GELDERN ***
$ retrotxt olavg10.txt --input cp1251
"Честит е тоз избранник, чийто дух,
като ковчега Ноев, пренесе
от прежний свят в послешний онова,
което е в промени непроменно.
Той подир смърт от себе си оставя
най-чистото, най-хубавото - жица
от царството на сенките безплътни,
която ще го свързва с тоя мир."
*** END OF THE PROJECT GUTENBERG EBOOK, OLAF VAN GELDERN ***
Features
- Display legacy code page encoded texts in modern terminals.
- Print or export detailed information about text files.
- Print or export the SAUCE metadata of files.
- Transform legacy encoded texts and text art into UTF-8 documents for use on the web or with modern systems.
- Look up code page and character tables for dozens of encodings and print the results.
- Support for ISO, PC-DOS/Windows code pages, IBM EBCDIC, Macintosh, and ShiftJIS encodings.
- Use I/O redirection with piping support.
Known code pages and text encodings
$ retrotxt list
┌──────────────────────────────────────────────────────────────────────────────┐
│ Formal name Named value Numeric value Alias value │
│ IBM Code Page 037 cp037 37 ibm037 │
│ IBM Code Page 437 cp437 437 msdos │
│ IBM Code Page 850 cp850 850 latinI │
│ IBM Code Page 852 cp852 852 latinII │
│ IBM Code Page 855 cp855 855 ibm855 │
│ Windows Code Page 858 cp858 858 ibm00858 │
│ IBM Code Page 860 cp860 860 ibm860 │
│ IBM Code Page 862 cp862 862 │
│ IBM Code Page 863 cp863 863 ibm863 │
│ IBM Code Page 865 cp865 865 ibm865 │
│ IBM Code Page 866 ibm866 866 │
│ IBM Code Page 1047 cp1047 1047 ibm1047 │
│ IBM Code Page 1140 cp1140 1140 ibm01140 │
│ ISO 8859-1 iso-8859-1 1 latin1 │
│ ISO 8859-2 iso-8859-2 2 latin2 │
│ ISO 8859-3 iso-8859-3 3 latin3 │
│ ISO 8859-4 iso-8859-4 4 latin4 │
│ ISO 8859-5 iso-8859-5 5 cyrillic │
│ ISO 8859-6 iso-8859-6 6 arabic │
│ ISO-8859-6E iso-8859-6-e iso88596e │
│ ISO-8859-6I iso-8859-6-i iso88596i │
│ ISO 8859-7 iso-8859-7 7 greek │
│ ISO 8859-8 iso-8859-8 8 hebrew │
│ ISO-8859-8E iso-8859-8-e iso88598e │
│ ISO-8859-8I iso-8859-8-i iso88598i │
│ ISO 8859-9 iso-8859-9 9 latin5 │
│ ISO 8859-10 iso-8859-10 10 latin6 │
│ ISO-8859-11 iso-8859-11 11 iso885911 │
│ ISO 8859-13 iso-8859-13 13 iso885913 │
│ ISO 8859-14 iso-8859-14 14 iso885914 │
│ ISO 8859-15 iso-8859-15 15 iso885915 │
│ ISO 8859-16 iso-8859-16 16 iso885916 │
│ KOI8-R koi8-r koi8r │
│ KOI8-U koi8-u koi8u │
│ Macintosh macintosh mac │
│ Windows 874 cp874 874 windows-874 │
│ Windows 1250 cp1250 1250 windows-1250 │
│ Windows 1251 cp1251 1251 windows-1251 │
│ Windows 1252 cp1252 1252 windows-1252 │
│ Windows 1253 cp1253 1253 windows-1253 │
│ Windows 1254 cp1254 1254 windows-1254 │
│ Windows 1255 cp1255 1255 windows-1255 │
│ Windows 1256 cp1256 1256 windows-1256 │
│ Windows 1257 cp1257 1257 windows-1257 │
│ Windows 1258 cp1258 1258 windows-1258 │
│ Shift JIS shift_jis shiftjis │
│ Big5 big5
