You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2024/04/24 20:45:00 UTC
[jira] (LANG-1729) NumberUtils.isParsable() returns true for Fullwidth Unicode digits
[ https://issues.apache.org/jira/browse/LANG-1729 ]
Gary D. Gregory deleted comment on LANG-1729:
---------------------------------------
was (Author: garydgregory):
But Integer.parseInt() works.
> NumberUtils.isParsable() returns true for Fullwidth Unicode digits
> ------------------------------------------------------------------
>
> 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
>
> *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)