From fca03033e4b3a908cc1c349c3e15e2e4d883b749 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 2 Jul 2024 00:50:36 -0400 Subject: a8utf8: removed (replaced by a8cat). --- Makefile | 4 +- a8utf8 | 172 ------------------------------------------------------------- a8utf8.1 | 125 -------------------------------------------- a8utf8.rst | 57 -------------------- 4 files changed, 2 insertions(+), 356 deletions(-) delete mode 100755 a8utf8 delete mode 100644 a8utf8.1 delete mode 100644 a8utf8.rst diff --git a/Makefile b/Makefile index 47cf854..ac7c4b3 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ CFLAGS=-Wall $(COPT) -ansi -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" # BINS and SCRIPTS go in $BINDIR, DOCS go in $DOCDIR BINS=a8eol atr2xfd atrsize axe blob2c blob2xex cart2xex cxrefbas dumpbas fenders protbas renumbas rom2cart unmac65 unprotbas vxrefbas xex1to2 xexamine xexcat xexsplit xfd2atr listbas a8cat a8xd -SCRIPTS=dasm2atasm a8utf8 -MANS=a8eol.1 xfd2atr.1 atr2xfd.1 blob2c.1 cart2xex.1 fenders.1 xexsplit.1 xexcat.1 atrsize.1 rom2cart.1 unmac65.1 axe.1 dasm2atasm.1 a8utf8.1 blob2xex.1 xexamine.1 xex1to2.1 unprotbas.1 protbas.1 renumbas.1 dumpbas.1 vxrefbas.1 cxrefbas.1 listbas.1 a8cat.1 a8xd.1 +SCRIPTS=dasm2atasm +MANS=a8eol.1 xfd2atr.1 atr2xfd.1 blob2c.1 cart2xex.1 fenders.1 xexsplit.1 xexcat.1 atrsize.1 rom2cart.1 unmac65.1 axe.1 dasm2atasm.1 blob2xex.1 xexamine.1 xex1to2.1 unprotbas.1 protbas.1 renumbas.1 dumpbas.1 vxrefbas.1 cxrefbas.1 listbas.1 a8cat.1 a8xd.1 MAN5S=xex.5 MAN7S=atascii.7 DOCS=README.txt equates.inc *.dasm LICENSE ksiders/atr.txt diff --git a/a8utf8 b/a8utf8 deleted file mode 100755 index 0cca2ac..0000000 --- a/a8utf8 +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -w - -# convert A8 text to UTF-8. Control graphics characters are replaced with -# nearest Unicode equivalents (mostly from the box-drawing range, or from -# the basic-latin range with -i option). - -# Careful editing this script: you need an editor that groks UTF-8, or at -# least one that won't mangle the UTF-8 sequences embedded in the tables -# below. - -($SELF = $0) =~ s,.*/,,; - -binmode(STDOUT, ":utf8"); -binmode(STDIN, ":bytes"); - -use utf8; - -%atascii_table = ( - 0 => "♥", - 1 => "┣", - 2 => "┃", - 3 => "┛", - 4 => "┫", - 5 => "┓", - 6 => "╱", - 7 => "╲", - 8 => "◢", - 9 => "▗", - 10 => "◣", - 11 => "▝", - 12 => "▘", - 13 => "▔", - 14 => "▁", - 15 => "▖", - 16 => "♣", - 17 => "┏", - 18 => "━", - 19 => "╋", - 20 => "●", - 21 => "▄", - 22 => "▎", - 23 => "┳", - 24 => "┻", - 25 => "▌", - 26 => "┗", - 27 => "␛", - 28 => "↑", - 29 => "↓", - 30 => "←", - 31 => "→", - 96 => "◆", - 123 => "♠", - 125 => "↰", - 126 => "◀", - 127 => "▶", - 136 => "◤", - 137 => "▛", - 138 => "◥", - 139 => "▙", - 140 => "▟", - 141 => "▆", - 142 => "🮅", - 143 => "▜", - 148 => "◙", - 149 => "▀", - 150 => "🮊", - 153 => "▐", - 155 => "\n", - 156 => "⍐", - 157 => "⍗", - 158 => "⍇", - 159 => "⍈", - 160 => "█", -); - -%xl_intl_table = ( - 0 => "á", - 1 => "ù", - 2 => "Ñ", - 3 => "É", - 4 => "ç", - 5 => "ô", - 6 => "ò", - 7 => "ì", - 8 => "£", - 9 => "ï", - 10 => "ü", - 11 => "ä", - 12 => "Ö", - 13 => "ú", - 14 => "ó", - 15 => "ö", - 16 => "Ü", - 17 => "â", - 18 => "û", - 19 => "î", - 20 => "é", - 21 => "è", - 22 => "ñ", - 23 => "ê", - 24 => "ȧ", - 25 => "à", - 26 => "Ȧ", - 27 => "␛", - 28 => "↑", - 29 => "↓", - 30 => "←", - 31 => "→", - 96 => "¡", - 123 => "Ä", - 126 => "◀", - 127 => "▶", - 155 => "\n", -); - -undef $/; - -$table = \%atascii_table; -$print_table = 0; -while(@ARGV && $ARGV[0] =~ /^-/) { - for($ARGV[0]) { - /^-i$/ && do { $table = \%xl_intl_table; next; }; - /^-t$/ && do { $print_table = 1; next; }; - /^-r$/ && do { $reverse = 1; next; }; - /^--?h/ && do { usage(0) }; - warn "$SELF: unknown option: $_\n"; - usage(1); - } - shift @ARGV; -} - -if($reverse) { - binmode(STDOUT, ":bytes"); - for(keys %$table) { - $revtable{ord($table->{$_})} = chr($_); - } - $table = \%revtable; -} - -if($print_table) { - for(sort { $a <=> $b } keys %$table) { - my $chr = translate(chr $_); - $chr = '\n' if $chr eq "\n"; - printf '"%d","$%02x","%s"' . "\n", $_, $_, $chr; - } - exit 0; -} - -$_ = <>; -s/(.)/translate($1)/seg; -print; - -sub translate { - my $o = ord(shift); - my $ret; - - $ret = $table->{$o}; - return $ret if defined($ret); - - $ret = $table->{$o & 0x7f}; - return $ret if defined($ret); - - return chr($o & 0x7f); -} - -sub usage { - print < a8utf8.1 -. -.\" rst2man.py comes from the SBo development/docutils package. -. -.SH SYNOPSIS -.sp -\fIa8utf8\fP [\fB\-r\fP] [\fB\-i\fP] [\fIinfile\fP] [\fIinfile ...\fP] -.sp -\fIa8utf8\fP [\fB\-r\fP] [\fB\-i\fP] \fB\-t\fP -.SH DESCRIPTION -.sp -Convert Atari 8\-bit ATASCII or XL ICS (International Character -Set) text to UTF\-8 encoded Unicode. Control graphics characters are -replaced with their nearest Unicode equivalents (mostly from the Box -Drawing block, or from the Basic Latin block with \fB\-i\fP option). -.sp -If no \fIinfile\fP is given, input is read from standard input. Output always -goes to standard output; to write to a file, use a command like: -.INDENT 0.0 -.INDENT 3.5 -.sp -.nf -.ft C -a8utf8 atari.txt > converted.txt -.ft P -.fi -.UNINDENT -.UNINDENT -.sp -The output is plain UTF\-8 Unicode, without BOM. -.sp -Inverse video (characters codes above \fB$80\fP) are translated to -their non\-inverse equivalents, except \fB$9B\fP (Atari EOL), which is -translated to \fB\en\fP (newline). -.SH OPTIONS -.INDENT 0.0 -.TP -.B \-i -Input uses Atari XL/XE International Character Set encoding, rather than -ATASCII graphics. -.TP -.B \-t -Print table of Atari to Unicode equivalents, in CSV format. Can -be used with or without \fB\-i\fP and/or \fB\-r\fP (four different tables). -.TP -.B \-r -Reverse conversion: Input is UTF\-8, output is ATASCII (or XL ICS, with \fB\-i\fP). -Beware that printing ATASCII to a terminal may look funny, and may even confuse -the terminal. Redirecting to a file is safe. -.UNINDENT -.SH COPYRIGHT -.sp -WTFPL. See \fI\%http://www.wtfpl.net/txt/copying/\fP for details. -.SH AUTHOR -.INDENT 0.0 -.IP B. 3 -Watson <\fI\%urchlay@slackware.uk\fP>; Urchlay on irc.libera.chat \fI##atari\fP\&. -.UNINDENT -.SH SEE ALSO -.sp -\fBa8eol\fP(1), -\fBa8utf8\fP(1), -\fBatr2xfd\fP(1), -\fBatrsize\fP(1), -\fBaxe\fP(1), -\fBblob2c\fP(1), -\fBblob2xex\fP(1), -\fBcart2xex\fP(1), -\fBcxrefbas\fP(1), -\fBdasm2atasm\fP(1), -\fBdumpbas\fP(1), -\fBf2toxex\fP(1), -\fBfenders\fP(1), -\fBlistbas\fP(1), -\fBprotbas\fP(1), -\fBrenumbas\fP(1), -\fBrom2cart\fP(1), -\fBunmac65\fP(1), -\fBunprotbas\fP(1), -\fBvxrefbas\fP(1), -\fBxexamine\fP(1), -\fBxexcat\fP(1), -\fBxexsplit\fP(1), -\fBxfd2atr\fP(1), -\fBxex\fP(5), -\fBatascii\fP(7). -.sp -Any good Atari 8\-bit book: \fIDe Re Atari\fP, \fIThe Atari BASIC Reference -Manual\fP, the \fIOS Users\(aq Guide\fP, \fIMapping the Atari\fP, etc. -.\" Generated by docutils manpage writer. -. diff --git a/a8utf8.rst b/a8utf8.rst deleted file mode 100644 index ec9fbba..0000000 --- a/a8utf8.rst +++ /dev/null @@ -1,57 +0,0 @@ -.. RST source for a8utf8(1) man page. Convert with: -.. rst2man.py a8utf8.rst > a8utf8.1 -.. rst2man.py comes from the SBo development/docutils package. - -====== -a8utf8 -====== - --------------------------------------------------- -Convert Atari 8-bit text to UTF-8 encoded Unicode. --------------------------------------------------- - -.. include:: manhdr.rst - -SYNOPSIS -======== - -*a8utf8* [**-r**] [**-i**] [*infile*] [*infile ...*] - -*a8utf8* [**-r**] [**-i**] **-t** - -DESCRIPTION -=========== - -Convert Atari 8-bit ATASCII or XL ICS (International Character -Set) text to UTF-8 encoded Unicode. Control graphics characters are -replaced with their nearest Unicode equivalents (mostly from the Box -Drawing block, or from the Basic Latin block with **-i** option). - -If no *infile* is given, input is read from standard input. Output always -goes to standard output; to write to a file, use a command like:: - - a8utf8 atari.txt > converted.txt - -The output is plain UTF-8 Unicode, without BOM. - -Inverse video (characters codes above **$80**) are translated to -their non-inverse equivalents, except **$9B** (Atari EOL), which is -translated to **\\n** (newline). - -OPTIONS -======= - --i - Input uses Atari XL/XE International Character Set encoding, rather than - ATASCII graphics. - --t - Print table of Atari to Unicode equivalents, in CSV format. Can - be used with or without **-i** and/or **-r** (four different tables). - --r - Reverse conversion: Input is UTF-8, output is ATASCII (or XL ICS, with **-i**). - Beware that printing ATASCII to a terminal may look funny, and may even confuse - the terminal. Redirecting to a file is safe. - -.. include:: manftr.rst -- cgit v1.2.3