Changeset 6094 in josm for trunk/src/org


Ignore:
Timestamp:
2013-07-31T01:12:19+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8918 - Handle Zero width space char since Java 7 changes related to Unicode 6.0

File:
1 edited

Legend:

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

    r6093 r6094  
    648648        while (leadingWhite && start < end) {
    649649            char c = str.charAt(start);
    650             leadingWhite = (Character.isWhitespace(c) || Character.isSpaceChar(c));
     650            // '\u200B' (ZERO WIDTH SPACE character) needs to be handled manually because of change in Unicode 6.0 (Java 7, see #8918)
     651            leadingWhite = (Character.isWhitespace(c) || Character.isSpaceChar(c) || c == '\u200B');
    651652            if (leadingWhite) {
    652653                start++;
     
    656657        while (trailingWhite && end > start+1) {
    657658            char c = str.charAt(end-1);
    658             trailingWhite = (Character.isWhitespace(c) || Character.isSpaceChar(c));
     659            trailingWhite = (Character.isWhitespace(c) || Character.isSpaceChar(c) || c == '\u200B');
    659660            if (trailingWhite) {
    660661                end--;
Note: See TracChangeset for help on using the changeset viewer.