Checker : different leading/trailing spaces does not detect inconsistent non-breaking spaces
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)
-
Account Deleted -
Account Deleted - changed status to resolved
Comment [2.](https://code.google.com/p/okapi/issues/detail?id=257#c2) originally posted by @ysavourel on 2012-07-30T17:07:58.000Z:
Fixed in "checker" branch.
- Log in to comment
Comment [1.](https://code.google.com/p/okapi/issues/detail?id=257#c1) originally posted by @ysavourel on 2012-07-26T03:37:36.000Z:
From the traditional definition of 'white-space' nbsp is not included. But you are right: I don't see a reason to exclude 'space chars' in this check. I'd say +1.