Changeset 6126 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2013-08-09T18:00:18+02:00 (11 years ago)
Author:
bastiK
Message:

applied #8953 - sorting by name relations with accented letters (patch by windu.2b)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/AlphanumComparator.java

    r6070 r6126  
    2323 *
    2424 */
     25import java.text.Collator;
    2526import java.util.Comparator;
     27import java.util.Locale;
    2628
    2729/**
     
    3335 *
    3436 * This is an updated version with enhancements made by Daniel Migowski, Andre
    35  * Bogus, and David Koelle.
     37 * Bogus, and David Koelle and others.
    3638 *
    3739 */
     
    107109                }
    108110            } else {
    109                 result = thisChunk.compareTo(thatChunk);
     111                // Instantiate the collator
     112                Collator compareOperator = Collator.getInstance(Locale.getDefault());
     113                // Compare regardless of accented letters
     114                compareOperator.setStrength(Collator.SECONDARY);
     115                result = compareOperator.compare(thisChunk, thatChunk);
    110116            }
    111117
Note: See TracChangeset for help on using the changeset viewer.