Skip to content

Commit fdbfaae

Browse files
committed
handle non whitespace space characters such as 'NO-BREAK SPACE'
1 parent 23a5133 commit fdbfaae

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/main/java/mil/nga/crs/wkt/TextReader.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,13 @@ private String readToken(boolean cache) throws IOException {
218218
} else {
219219
// Complete the token before this character and cache
220220
// the character
221-
if (!Character.isWhitespace(character)) {
221+
if (!isWhitespace(character)) {
222222
nextCharacterNum = characterNum;
223223
}
224224
break;
225225
}
226226

227-
} else if (!Character.isWhitespace(character)) {
227+
} else if (!isWhitespace(character)) {
228228

229229
// First non whitespace character in the token
230230
builder = new StringBuilder();
@@ -452,4 +452,15 @@ private static boolean isQuoteCharacter(char c) {
452452
return quote;
453453
}
454454

455+
/**
456+
* Check if the character is whitespace or a space character
457+
*
458+
* @param c
459+
* character
460+
* @return true if whitespace
461+
*/
462+
private static boolean isWhitespace(char c) {
463+
return Character.isWhitespace(c) || Character.isSpaceChar(c);
464+
}
465+
455466
}

0 commit comments

Comments
 (0)