Skip to content

Commit

Permalink
fixed files form Lang #54
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent f507856 commit 29b07d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions projects/Lang/54/org/apache/commons/lang/LocaleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public static Locale toLocale(String str) {
throw new IllegalArgumentException("Invalid locale format: " + str);
}
char ch3 = str.charAt(3);
if (ch3 == '_') {
return new Locale(str.substring(0, 2), "", str.substring(4));
}
char ch4 = str.charAt(4);
if (ch3 < 'A' || ch3 > 'Z' || ch4 < 'A' || ch4 > 'Z') {
throw new IllegalArgumentException("Invalid locale format: " + str);
Expand Down

0 comments on commit 29b07d6

Please sign in to comment.