Checker : different leading/trailing spaces does not detect inconsistent non-breaking spaces

Issue #257 resolved
Former user created an issue

Original [issue 257](https://code.google.com/p/okapi/issues/detail?id=257) created by @ysavourel on 2012-07-25T23:53:13.000Z:

The summary says it all. (Windows, m17)

Explanation:

The current detection uses Character.isWhitespace That method does not consider nbsp as whitespace (javadoc, also tested).

Proposed fix:

I have tried isSpace, isSpaceChar, and isWhitespace for all char between 0 and FFFF. isSpaceChar is the only one returning true for nbsp.

Change the test to do isWhitespace | isSpaceChar The only characters that will give different results are: 0x00A0 NO-BREAK SPACE;Zs;0;CS;<noBreak> 0020 0x2007 FIGURE SPACE;Zs;0;WS;<noBreak> 0020 0x202F NARROW NO-BREAK SPACE;Zs;0;CS;<noBreak> 0020

I think it is safe to change.

I will fix it if you "Accept" it

Comments (2)

  1. Log in to comment