[
https://issues.apache.org/jira/browse/LANG-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15103886#comment-15103886
]
ASF GitHub Bot commented on LANG-1184:
--------------------------------------
Github user garydgregory commented on the pull request:
https://github.com/apache/commons-lang/pull/113#issuecomment-172369835
Hi All,
I'm more concerned about what the proper behavior of the method is, rather
than its behavior in some past arbitrary version. Since Java does not define a
nbsp as a whitespace, it should not be normalized away IMO. Now, if you want it
normalized, we could talk about adding another method or documenting how to
deal with this special use case.
Are there other characters that are ws-like characters that return false
for Character.isWhitespace(). Unicode is pretty rich, maybe there is more. What
would this new method be called?
> StringUtils#normalizeSpace no longer normalizes unicode non-breaking spaces
> (\u00A0) and does not trim control chars at the end any more
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: LANG-1184
> URL: https://issues.apache.org/jira/browse/LANG-1184
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.4
> Reporter: Pascal Schumacher
>
> These work with 3.3.2, but fail with 3.4
> {code:java}assertEquals("a b", StringUtils.normalizeSpace("a\u00A0 b"));{code}
> {code:java}assertEquals("b", StringUtils.normalizeSpace("b\u0000"));{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)