Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8032842

Locale.filterTags()/lookupTag() methods return lowercased language tags

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 8, 9
    • core-libs
    • None
    • b15
    • generic
    • generic
    • Verified

      Currently the returned language tag(s) from those methods are all in lower case letters. Although language tags/subtags are case inensitive, instead of converting the matching language tag(s) to lowercase, these methods should preserve the case of input language tag(s)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the code below


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args) {
          List<LanguageRange> priorityList = LanguageRange.parse("*-CH");
          List<String> matchingTags = Locale.filterTags(priorityList, List.of("de-CH", "hi-in", "En-GB"),
      FilteringMode.AUTOSELECT_FILTERING);
          System.out.println(matchingTags);
      }
      ---------- END SOURCE ----------

      EXPECTED: "de-CH"
      FOUND: "de-ch"

            nishjain Nishit Jain
            naoto Naoto Sato
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: