-my $query = $ENV{PATH_INFO} || $get{q} || 'ipa';
-for ($query) {
- s{^/}{};
- when (qr{^[a-z]+(?:/|\z)}) {
- for (split / /) {
- push @querydesc, "preset group $_";
- my ($tablegroup, $tablename) = split m{/}, $_, 2;
- my @tables = $tablename ? $tables->{$tablegroup}->{$tablename}
- : sort values %{ $tables->{$tablegroup} };
- for (@tables) {
- my $includerows; # ignore rows before body row
- for (@{$_}) {
- $includerows ||= m/^[.]/ or next;
- next if /^[.-]/;
- next if $_ eq '>' or $_ eq '=';
- push @chars, $_;
- }
+if (my $query = $ENV{PATH_INFO} || $get{q} || 'ipa') {
+ my $groupinfo = do 'unicode-cover.inc.pl' or die $@ || $!;
+ for (split /[\s+]/, $query) {
+ s{^/}{};
+ when (qr{^[\d,;\s+-]+$}) {
+ push @querydesc, "character codepoints $_";
+ for (map { split /[^\d-]/ } $_) {
+ my ($charnum, $range) = split /-/, $_;
+ push @chars, chr $_ for $charnum .. ($range // $charnum);