为什么Apache Commons认为数字是"१२३"?

问题描述:

根据Apache Commons Lang关于

According to Apache Commons Lang's documentation for StringUtils.isNumeric(), the String '१२३' is numeric.

由于我认为这可能是文档中的错误,因此我进行了测试以验证该声明.我发现根据Apache Commons,它是 数字.

Since I believed this might be a mistake in the documentation, I ran tests to verify the statement. I found that according to Apache Commons it is numeric.

为什么这个字符串是数字的?这些字符代表什么?

Why is this String numeric? What do those characters represent?

因为"CharSequence仅包含Unicode数字", (引用您的

Because that "CharSequence contains only Unicode digits" (quoting your linked documentation).

所有字符对于

All of the characters return true for Character.isDigit:

某些包含数字的Unicode字符范围:

Some Unicode character ranges that contain digits:

  • "\ u0030"至"\ u0039",ISO-LATIN-1数字("0"至"9")
  • '\ u0660'至'\ u0669',阿拉伯文-印度数字
  • 从'\ u06F0'到'\ u06F9',扩展的阿拉伯语-印度数字
  • '\ u0966'至'\ u096F',梵文数字
  • '\ uFF10'至'\ uFF19',全角数字

其他许多字符范围也包含数字.

Many other character ranges contain digits as well.

१२३是梵文数字: