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

Locale("da","DK") sorts incorrectly

    XMLWordPrintable

    Details

      Description



      Name: skT45625 Date: 11/06/2000


      java version "1.2.2"
      Solaris VM (build Solaris_JDK_1.2.2_05a, native threads, sunwjit)


      When you sort text, "nothing precedes everything". Ie. "man woman" precedes
      "manic". This is currently not the case when using the Locale da_DK.


      import java.text.Collator;
      import java.util.Locale;
      public class Sort
      {
         public static void main (String [] argv)
         {
             String s1 = "DANSKERE";
             String s2 = "DANSK GRAMMATIK I PRAKSIS 1";

             Collator coll = Collator.getInstance (new Locale("da","DK"));
             coll.setStrength(Collator.IDENTICAL);
             int res = coll.compare(s1, s2);
             if (res == 0) {
                 System.out.println("[" + s1 + "] equals [" + s2 + "]");
             }
             if (res < 0) {
                 System.out.println("[" + s1 + "] is less than [" + s2 + "]");
             }
             if (res > 0) {
                 System.out.println("[" + s2 + "] is less than [" + s1 + "]");
             }
         }
      }
      (Review ID: 111879)
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            kcolfersunw Kieran Colfer (Inactive)
            Reporter:
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: