为什么Apache Commons认为数字是"१२३"? [英] Why does Apache Commons consider '१२३' numeric?

查看:208
本文介绍了为什么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.

१२३是梵文数字:

这篇关于为什么Apache Commons认为数字是"१२३"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆