diff options
Diffstat (limited to 'CHARSET/SBCSGEN.PL')
-rw-r--r-- | CHARSET/SBCSGEN.PL | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/CHARSET/SBCSGEN.PL b/CHARSET/SBCSGEN.PL index 078aebf7..6012c933 100644 --- a/CHARSET/SBCSGEN.PL +++ b/CHARSET/SBCSGEN.PL @@ -1,11 +1,19 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # This script generates sbcsdat.c (the data for all the SBCSes) from its # source form sbcs.dat. -$infile = "sbcs.dat"; +use warnings; +use Getopt::Long; +use File::Basename; + +$infile = (dirname __FILE__) . "/sbcs.dat"; $outfile = "sbcsdat.c"; +my $usage = "usage: sbcsgen.pl [-o OUTFILE]\n"; +GetOptions("o|output=s" => \$outfile) + or die $usage; + open FOO, $infile; open BAR, ">$outfile"; select BAR; @@ -30,7 +38,7 @@ my @charsetnames = (); my @sortpriority = (); while (<FOO>) { - chomp; + chomp; y/\r//d; if (/^charset (.*)$/) { $charsetname = $1; @vals = (); |