summaryrefslogtreecommitdiff
path: root/utilities/perl/localecap.pl
blob: f5d846ebb68b0d9e04399b3474472af90acfc3e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

# This tool is only for locales in Latin-1, not UTF-8 (should such locales be supported at a later date)

use locale;

$abbrevs = 0;

open (INPUT, "$ARGV[0]") or print "Give the locale file as an argument.\n";
@loc = <INPUT>;
close (INPUT);
open (OUTPUT, ">$ARGV[0]");
foreach $line (@loc) {

    if ($line =~ /\[Book Abbrevs\]/) {
	$abbrevs = 1;
    }
    elsif ($abbrevs == 1) {
	$line = uc($line);
    }
    print OUTPUT $line;
}
close (OUTPUT);