#!/usr/bin/env perl use utf8; ############################################################################### # This program converts input stream of characters to Unicode codepoints in hexadecimal. # # Copyright © 2020 Richard Lesh. All rights reserved. ############################################################################### use Utils; use strict; use warnings; MAIN: { binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); binmode(STDIN, ":utf8"); my $c; my $hex; my $count = 0; while (defined($c = Utils::getchar(*STDIN))) { ++$count; $hex = Utils::messageFormat("\{0:06x\} ", $c); print $hex; if ($count % 10 == 0) { print "\n"; } } }