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

Wrong sorting rule for letters v and w in Norwegian Locale ("no", "NO")

    Details

    • Subcomponent:
    • Resolved In Build:
      tiger
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description



      Name: rmT116609 Date: 04/15/2003


      FULL PRODUCT VERSION :
      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)


      FULL OS VERSION :
      Microsoft Windows XP [Version 5.1.2600] (Norwegian edition of Win XP)

      A DESCRIPTION OF THE PROBLEM :
      The letters v and w are treated as same letters when using Arrays.sort with Locale ("no", "NO").

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Se code example below.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      vard
      verd
      vird
      ward
      werd
      wird

      vard
      ward
      verd
      werd
      vird
      wird


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.text.*;
      import java.util.*;

      /**********************************************************
      * This program demonstrates that a wrong sorting rule is
      * applied to the letters v and w, when using the
      * Norwegian Locale ("no", "NO").
      * It's a slightly modified version of the program reported
      * with Bug ID 4804273.
      ***********************************************************/
      public class CollatorTest {

        /********************************************************
        *********************************************************/
        public static void main (String[] args) {
          Locale loc = new Locale ("no", "NO"); // Norwegian

          Locale.setDefault (loc);
          Collator col = Collator.getInstance ();

          String[] data = {"wird",
                           "vird",
                           "verd",
                           "werd",
                           "vard",
                           "ward"};
          Arrays.sort (data, col);

          System.out.println ("Using " + loc.getDisplayName());
          for (int i = 0; i < data.length; i++) {
            System.out.println (data[i]);
          }//end for
        }//end main

      }//end class CollatorTest

      ---------- END SOURCE ----------

      (Review ID: 184128)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              kcolfersunw Kieran Colfer (Inactive)
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: