[corlib] Update locale tables. Fixes #40697
[mono.git] / tools / locale-builder / Driver.cs
index becba3e1da912fb96c30d66c30ffaf5ca005eda6..b922d750ec68547c3029d8034fbeb52adf500361 100644 (file)
@@ -379,9 +379,13 @@ namespace Mono.Tools.LocaleBuilder
                                        throw new NotImplementedException ();
                                }
 
-                               var territories = entry.Attributes["territories"].Value.Split ();
+                               var territories = entry.Attributes["territories"].Value.Split (new [] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
                                foreach (var t in territories) {
-                                       territory2dayofweek.Add (t, dow);
+                                       var tr = t.Trim ();
+                                       if (tr.Length == 0)
+                                               continue;
+
+                                       territory2dayofweek.Add (tr, dow);
                                }
                        }
 
@@ -619,27 +623,6 @@ namespace Mono.Tools.LocaleBuilder
                                                break;
                                        }
                                }
-
-                               if (nfe.CurrencyDecimalDigits == null) {
-                                       var all_digits = new List<string> ();
-                                       GetAllChildrenValues (ci, all_digits, l => l.NumberFormatEntry.CurrencyDecimalDigits);
-                                       var children = all_digits.Where (l => l != null).Distinct ().ToList ();
-
-                                       if (children.Count == 1) {
-                                               nfe.CurrencyDecimalDigits = children[0];
-                                       } else if (children.Count == 0) {
-                                               if (!ci.HasMissingLocale)
-                                                       Console.WriteLine ("No currency decimal digits data for `{0}'", ci.Name);
-
-                                               nfe.CurrencyDecimalDigits = "2";
-                                       } else if (ci.IsNeutral) {
-                                               nfe.CurrencyDecimalDigits = "2";
-                                       } else {
-                                               // .NET has weird concept of territory data available for neutral cultures (e.g. en, es, pt)
-                                               // We have to manually disambiguate the correct entry (which is artofficial anyway)
-                                               throw new ApplicationException (string.Format ("Ambiguous currency decimal digits data for `{0}'", ci.Name));
-                                       }
-                               }
                        }
 
                        if (OutputCompare)
@@ -1164,30 +1147,6 @@ namespace Mono.Tools.LocaleBuilder
                                        ni.PercentSymbol = el.InnerText;
 
                        }
-
-                       string value = null;
-
-                       // .net has incorrect separators for some countries and we want to be compatible
-                       switch (ci.Name) {
-                       case "es-ES":
-                       case "es":
-                               // es-ES does not have group separator but .net has '.'
-                               value = ".";
-                               break;
-                       default:
-                               if (node != null) {
-                                       el = node.SelectSingleNode ("group");
-                                       if (el != null) {
-                                               value = el.InnerText;
-                                       }
-                               }
-
-                               break;
-                       }
-                                       
-                       if (value != null) {
-                               ni.NumberGroupSeparator = ni.CurrencyGroupSeparator = value;
-                       }
                }
 
                static void ToLower (string[] values)