summaryrefslogtreecommitdiff
path: root/i18nlangtag
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-01 16:51:11 +0100
committerEike Rathke <erack@redhat.com>2018-03-01 16:59:17 +0100
commit261f7f449f40b4801e9d51a665ad995f13ac40f4 (patch)
treea2c2507861e1a82a5cc1a87bffe23b1754338af5 /i18nlangtag
parenta93a0ff49c9ad576b25b5c9357a15f40ac0962bc (diff)
Generate MS-LCID.lst with uppercase hex and unified spaces
As content and layout in the original PDF changes back and forth. Change-Id: I4666343f9c9d1bd779c80b9031f5b85de4363a58
Diffstat (limited to 'i18nlangtag')
-rwxr-xr-xi18nlangtag/source/isolang/MS-LCID-to-list.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/i18nlangtag/source/isolang/MS-LCID-to-list.sh b/i18nlangtag/source/isolang/MS-LCID-to-list.sh
index 0012bfc9cdf5..73fe410fea51 100755
--- a/i18nlangtag/source/isolang/MS-LCID-to-list.sh
+++ b/i18nlangtag/source/isolang/MS-LCID-to-list.sh
@@ -7,10 +7,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Generates language ID table and defines and mappings of
-# http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-LCID%5D.pdf
+# https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-LCID/[MS-LCID].pdf
# downloaded from http://msdn.microsoft.com/library/cc233965.aspx
# At least this worked for Release: Monday, July 22, 2013; 08/08/2013 Revision 6.0
# Also worked for 6/30/2015 revision 7.0
+# Also worked for 12/1/2017 revision 11.0
#
# Uses pdftotext (from poppler-utils), grep and gawk.
#
@@ -19,7 +20,10 @@
# Files created/OVERWRITTEN: MS-LCID.txt, MS-LCID.lst, MS-LCID.lst.h
#
# Best invoked in a temporary directory ...
-# Layout may change, diff MS-LCID.lst with ignore spaces against the previous
+#
+# As the PDF layout may change, MS-LCID.lst is generated with uppercase hex
+# digits and unified spaces (which gawk $1=... automatically does).
+# Still, if needed, diff MS-LCID.lst with ignore spaces against the previous
# version for changes and additions, e.g.
# gvimdiff -c 'set diffopt+=iwhite' ../MS-LCID.lst MS-LCID.lst
# The generated MS-LCID.lst.h file is only a copy&paste help to add entries in
@@ -27,10 +31,11 @@
# lang.h and isolang.cxx
pdftotext -layout MS-LCID.pdf
-grep '^ *0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F] ' MS-LCID.txt > MS-LCID.lst
+grep '^ *0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F] ' MS-LCID.txt | \
+ gawk -e '{ $1 = "0x" toupper( substr( $1, 3)); print; }' > MS-LCID.lst
gawk -e '
{
- val = "0x" toupper( substr( $1, 3));
+ val = $1;
tag = $2;
tag = gensub( /,.*/, "", 1, tag);
def = $2;