]> granicus.if.org Git - icu/commitdiff
ICU-8971 fixed inconsistency bug between C and J for parsing and canonicalization
authorDebabrata Sengupta <dsengup@svn.icu-project.org>
Thu, 21 Jun 2012 19:52:29 +0000 (19:52 +0000)
committerDebabrata Sengupta <dsengup@svn.icu-project.org>
Thu, 21 Jun 2012 19:52:29 +0000 (19:52 +0000)
X-SVN-Rev: 31975

icu4c/source/common/uloc.cpp

index 42678feb48eb2747d2de7197de250605db5d2760..557bbf4b22da0c367b2fdd40601f9b5f51a4f659 100644 (file)
@@ -1701,7 +1701,7 @@ _canonicalize(const char* localeID,
             }
             if(_isIDSeparator(*tmpLocaleID)) {
                 /* If there is something else, then we add the _  if we found country before.*/
-                if (cntrySize > 0) {
+                if (cntrySize >= 0 && ! _isIDSeparator(*(tmpLocaleID+1)) ) {
                     ++fieldCount;
                     if(len<nameCapacity) {
                         name[len]='_';