[ 
https://issues.apache.org/jira/browse/LANG-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary D. Gregory resolved LANG-1729.
-----------------------------------
    Fix Version/s: 3.20.1
       Resolution: Fixed

[~xdex] 

Please see git master and snapshot builds in 
https://repository.apache.org/content/repositories/snapshots/

Only float and double parsing don't allow full-width Unicode digits; these two 
require ASCII digits.

 

> NumberUtils.isParsable() returns true for full width Unicode digits for 
> inputs with a decimal point
> ---------------------------------------------------------------------------------------------------
>
>                 Key: LANG-1729
>                 URL: https://issues.apache.org/jira/browse/LANG-1729
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.14.0
>            Reporter: Andrei Anischevici
>            Priority: Major
>             Fix For: 3.20.1
>
>
> *NumberUtils.isParsable()* returns *true* for Fullwidth Unicode digits 
> (U+FF10 to U+FF19, see 
> [https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)]),
>  even though these cannot be parsed by *Double.parseDouble()* and 
> {*}Float.parseFloat(){*}, as {*}NumberFormatException{*}s are thrown when 
> trying to parse these.
> I've also opened a JDK bug, see 
> [https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8326627] and 
> [https://bugs.openjdk.org/projects/JDK/issues/JDK-8326627]
> Since the underlying issue is that *Character.isDigit()* returns *true* for 
> fullwidth digits and until this is fixed in the JDK, it would be great to fix 
> this in *NumberUtils.isParsable()* so that it would return *false* for 
> Fullwidth Unicode digits.
> Gist reproducing the issue: 
> [https://gist.github.com/XDex/2e300189a07e8224524100f26b5f6b46]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to