1 package Shiar_Sheet::KeySigns;
7 our $VERSION = 'v1.00';
13 if (exists $PLP::Script::get{ascii}) {
15 $ascii = !defined $PLP::Script::get{ascii} || $PLP::Script::get{ascii} !~ /^0*$/;
17 elsif (defined $ENV{HTTP_ACCEPT_CHARSET}) {
19 for (split q{,}, $ENV{HTTP_ACCEPT_CHARSET}) {
20 $ascii = undef, last if $_ eq '*' or m{utf-?8}i;
26 charset=> $ascii ? 'us-ascii' : 'utf-8',
27 arg => $ascii ? '.' : '·', # described as 'dot'
28 args => $ascii ? ':' : '⁚',
29 argi => $ascii ? "'" : '′',
30 argm => $ascii ? '|' : '↕',
31 motion => $ascii ? '|' : '↕',
32 alias => $ascii ? 'see: ' : '»',
33 up => $ascii ? 'up' : '▲',
34 right => $ascii ? 'right' : '▶',
35 down => $ascii ? 'down' : '▼',
36 left => $ascii ? 'left' : '◀',
37 sep => $ascii ? '*' : '•',
38 _ => defined $ascii && !$ascii ? "\x{200b}" : '<wbr>',
39 # use the correct ZWNJ only when unicode is forced on
40 # default to use unofficial html for best support
43 my ($parent) = caller;
44 eval '*'.$parent.'::sign = \%sign';
53 Shiar_Sheet::KeySigns - Common Unicode characters in user-preferred charset
57 use Shiar_Sheet::KeySigns;
58 print "$sign{alias} some$sign{_}thing"; # see: some<wbr>thing
61 our %get = (ascii => 0); # user input
62 Shiar_Sheet::KeySigns->import;
63 print "$sign{alias} some$sign{_}thing"; # »some( )thing
67 Mischa POSLAWSKY <perl@shiar.org>
71 Copyright. All rights reserved.