go.text/locale: fixed bug where "kw" was interpreted as a 3-letter ISO code.
R=r
CC=golang-dev
https://golang.org/cl/9896044
diff --git a/locale/lookup_test.go b/locale/lookup_test.go
index fcdb0ac..4f9df2a 100644
--- a/locale/lookup_test.go
+++ b/locale/lookup_test.go
@@ -96,6 +96,7 @@
{id: "ji", bcp47: "ji", iso3: "yid-", norm: "yi"},
{id: "jw", bcp47: "jw", iso3: "jav-", norm: "jv"},
{id: "ar", bcp47: "ar", iso3: "ara"},
+ {id: "kw", bcp47: "kw", iso3: "cor"},
{id: "arb", bcp47: "arb", iso3: "arb", norm: "ar"},
{id: "ar", bcp47: "ar", iso3: "ara"},
{id: "kur", bcp47: "ku", iso3: "kur"},
diff --git a/locale/maketables.go b/locale/maketables.go
index f937733..f959796 100644
--- a/locale/maketables.go
+++ b/locale/maketables.go
@@ -612,6 +612,9 @@
// altLangISO3 get the alternative ISO3 names that need to be mapped.
altLangISO3 := stringSet{}
+ // Add dummy start to avoid the use of index 0.
+ altLangISO3.add("000")
+ altLangISO3.updateLater("000", "aa")
// legacyTag maps from tag to language code.
legacyTag := make(map[string]string)
diff --git a/locale/tables.go b/locale/tables.go
index 5acced9..1e72ced 100644
--- a/locale/tables.go
+++ b/locale/tables.go
@@ -17,17 +17,17 @@
var lang string = "" +
"aaarabbkaeveaffrakkaammhanrgarraassmavvaayymazzebaakbeelbgul" +
"bhihbiisbmambnenboodbrrebsoscaatcehechhacooscrrecsescuhucvhv" +
- "cyymdaandeeudsb\x00dvivdzzoeeweelllenngeopoes\x00\x04etsteuu" +
+ "cyymdaandeeudsb\x00dvivdzzoeeweelllenngeopoes\x00\x05etsteuu" +
"sfaasffulfiinfjijfoaofrrafrr\x00frs\x00fyrygalegdlagllggnrng" +
"sw\x00guujgvlvhaauheebhiinhomohrrvhsb\x00htathuunhyyehzerian" +
- "aidndieleigboiiiiikpkinndiodoisslittaiukuiw\x00\x02japnji" +
- "\x00\x05jvavjwavkaatkgonkiikkjuakkazklalkmhmknankoorkok\x00k" +
- "rauksaskuurkvomkw\x00\x00kyirlaatlbtzlgugliimlninloaoltitluu" +
+ "aidndieleigboiiiiikpkinndiodoisslittaiukuiw\x00\x03japnji" +
+ "\x00\x06jvavjwavkaatkgonkiikkjuakkazklalkmhmknankoorkok\x00k" +
+ "rauksaskuurkvomkw\x00\x01kyirlaatlbtzlgugliimlninloaoltitluu" +
"blvavmai\x00men\x00mglgmhahmirimis\x00mkkdmlalmnonmoolmrarms" +
"samtltmul\x00myyanaaunbobnddends\x00neepngdoniu\x00nlldnnnon" +
"oornqo\x00nrblnso\x00nvavnyyaocciojjiomrmorriossspaanpiliplo" +
- "lpsusptorquuermohrnunroonruusrw\x00\x03saanscrdsdndsemesgags" +
- "h\x00\x01siinsklksllvsmmosnnasoomsqqisrrpssswstotsuunsvwesww" +
+ "lpsusptorquuermohrnunroonruusrw\x00\x04saanscrdsdndsemesgags" +
+ "h\x00\x02siinsklksllvsmmosnnasoomsqqisrrpssswstotsuunsvwesww" +
"ataamteeltem\x00tggkthhatiirtkuktkl\x00tlgltmh\x00tnsntoontp" +
"i\x00trurtssottattvl\x00twwityahugigukkrund\x00urrduzzbveenv" +
"iievoolwalnwoolxhhoyiidyoorzahazbl\x00zhhozuulzxx\x00\xff" +
@@ -229,8 +229,8 @@
// altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives
// to 2-letter language codes that cannot be derived using the method described above.
// Each 3-letter code is followed by its 1-byte langID.
-// Size: 44 bytes
-var altLangISO3 string = "corchbs\xa1hebPkin\x9bspa(yidR\xff\xff\xff\xff"
+// Size: 48 bytes
+var altLangISO3 string = "000\x00corchbs\xa1hebPkin\x9bspa(yidR\xff\xff\xff\xff"
// langOldMap maps deprecated langIDs to their suggested replacements.
// Size: 108 bytes, 27 elements
@@ -609,4 +609,4 @@
25, 74, 62,
}
-// Size: 8.7K (8876 bytes); Check: D7ACA2A7
+// Size: 8.7K (8880 bytes); Check: FCB76CB5