LANG-826 FastDateParser does not handle non-ASCII digits correctly

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1389673 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-09-25 01:07:01 +00:00
parent bb8164bb2c
commit 62d5c0eecb
2 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@
<body>
<release version="3.2" date="TBA" description="Next release">
<action issue="LANG-826" type="fix">FastDateParser does not handle non-ASCII digits correctly</action>
<action issue="LANG-825" type="add">Create StrBuilder APIs similar to String.format(String, Object...)</action>
<action issue="LANG-817" type="fix">Add org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_8</action>
<action issue="LANG-813" type="fix">StringUtils.equalsIgnoreCase doesn't check string reference equality</action>

View File

@ -684,10 +684,10 @@ public boolean isNumber() {
@Override
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
if(parser.isNextNumber()) {
regex.append("(\\d{").append(parser.getFieldWidth()).append("}+)");
regex.append("(\\p{IsNd}{").append(parser.getFieldWidth()).append("}+)");
}
else {
regex.append("(\\d++)");
regex.append("(\\p{IsNd}++)");
}
return true;
}