[ 
https://issues.apache.org/jira/browse/LANG-1184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15118036#comment-15118036
 ] 

ASF GitHub Bot commented on LANG-1184:
--------------------------------------

Github user PascalSchumacher commented on the pull request:

    https://github.com/apache/commons-lang/pull/113#issuecomment-175231559
  
    Hi Gary,
    
    3.0 had the same behavior as 3.3.2, but I guess this is not a productive 
discussion.
    
    I know that `Character.isWhitespace` defines `\u00A0` as not a white space, 
but for example guava 
https://github.com/google/guava/blob/8fbeb9038cbe8b382b1ee188ae8459203cd04fb5/guava/src/com/google/common/base/CharMatcher.java#L1217
 classifies it as whitespace.
    
    If you want to keep the changed behavior I suggest at least to re-add the 
`trim()` call or to remove the `Additionally <code>{@link #trim(String)}</code> 
removes control characters (char &lt;= 32) from both ends of this String.` part 
of the java doc.
    
    I'm not unicode expert, but 
https://en.wikipedia.org/wiki/Non-breaking_space has a list of some more 
non-breaking-space unicode characters.
    
    As for the method name I guess the easy way out would be to add a flag to 
normalize space. I can not come up with a good method name at the moment 
`normalizeAllSpace`, is my best try.


> 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)

Reply via email to