diff options
| author | Jens Schweikhardt <schweikh@schweikhardt.net> | 2025-08-29 23:51:59 +0200 |
|---|---|---|
| committer | Jens Schweikhardt <schweikh@schweikhardt.net> | 2025-08-29 23:51:59 +0200 |
| commit | 86930a3db7ad752e46eee5822c43c4e53bc7f9bf (patch) | |
| tree | 35a9b7ae6f49df347b7eb3c3392efe3067ba40d5 /src2hex.pl | |
| parent | 717163410a7ec8fea1d8553ddc071a9805922d1b (diff) | |
0-31 are DEC VT100. Provide table. More symbols.
Diffstat (limited to 'src2hex.pl')
| -rwxr-xr-x | src2hex.pl | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src2hex.pl b/src2hex.pl deleted file mode 100755 index 6fa7998..0000000 --- a/src2hex.pl +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env perl -# - -use warnings; -use diagnostics; -use strict; -use utf8; -binmode(STDIN, ":encoding(UTF-8)"); -binmode(STDOUT, ":encoding(UTF-8)"); -binmode(STDERR, ":encoding(UTF-8)"); - -my $width = 12; -my $height = 22; -my $dblwidth = 2 * $width; - -print "# Width: $width\n"; -print "# Height: $height\n"; -while (<>) { - if (/^STARTCHAR U\+([[:xdigit:]]{4,})/) { - print "$1:"; - } - elsif (/^[[:digit:]]+ \|([ █]{$width})\|/u) { - my $bits = $1; - $bits =~ tr/ █/01/; - print unpack("H*", pack("B*", $bits . "0000")); # 12 bits + 0000 - } - elsif (/^[[:digit:]]+ \|([ █]{$dblwidth})\|/u) { - my $bits = $1; - $bits =~ tr/ █/01/; - print unpack("H*", pack("B*", $bits)); # 24 bits - } - elsif (/^ENDCHAR$/) { - print "\n"; - } - else { - print STDERR "unrecognized line: $_"; - exit 1; - } -} - -# vi: set tabstop=2 shiftwidth=2 expandtab fileformat=unix: |
