blob: d6caefcd51021481c8fb01fe8cb4f030f23014de (
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
26
27
28
29
30
31
32
33
|
#!/bin/awk -f
# makes a table of character sets from http://www.iana.org/assignments/character-sets/character-sets.xml
# and tcs.txt
/<name>/, /<\/name>/ {
gsub(/[<>\/]+/, " ")
i = 0
name = tolower($2)
names[name] = name
alias[name i] = name
nalias[name] = ++i
next
}
/<alias>/, /<\/alias>/ {
gsub(/[<>\/]+/, " ")
a = tolower($2)
names[a] = name
alias[name i] = a
nalias[name] = ++i
next
}
END {
while(getline <ARGV[2]){
tcs = $1
if(tcs in names){
name = names[tcs]
for(n = 0; n < nalias[name]; n++)
print "\"" alias[name n] "\", \"" $2 "\","
}
}
}
|