Locale variant delimiter is unclear

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: core-libs

      Locale states that

      "Well-formed {@code variant} values have the form {@code SUBTAG (('_'|'-') SUBTAG)*} ... BCP 47 only uses hyphen ('-') as a delimiter, {@code Locale} is more lenient."

      However, there is a wide range of behavior which makes the lack of detail confusing.

      `Locale.of` can take multiple variants separated by underscore.
      `Locale.forLanguageTag` allows multiple variants separated by hyphen.
      `Locale.Builder.setLanguageTag` allows variants only separated by hyphen.
      `Locale.Builder.setVariant` allows multiple variants separated by either underscore or hyphen.

            Assignee:
            Justin Lu
            Reporter:
            Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: