aboutsummaryrefslogtreecommitdiff
path: root/iconvdata/gaptab.pl
blob: 77df1c3aea6cfd0933057334b961bb383bbbb43a (plain)
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
$first=$last=$idx=0;
sub fmt {
  printf ("\n ") if (($n % 8) == 0);
  ++$n;
  my($val) = pop(@_);
  printf (" '\\x%02x',", $val);
}
while (<>) {
  local($ucs,$char,$rest) = split;
  local($u)=hex($ucs);
  local($c)=hex($char);
  if ($u - $last > 6) {
    if ($last != 0) {
      $idx += $last - $first + 1;
    }
    $first=$u;
  } else {
    for ($m = $last + 1; $m < $u; ++$m) {
      fmt (0);
    }
  }
  fmt ($c);
  $last=$u;
}
printf ("\n");