From: Debabrata Sengupta Date: Mon, 9 Jul 2012 18:25:45 +0000 (+0000) Subject: ICU-8971 fixed parsing inconsistency and corrected few test cases X-Git-Tag: milestone-59-0-1~3724 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f81fa564683bc36daeef8d8afade952dcde84aab;p=icu ICU-8971 fixed parsing inconsistency and corrected few test cases X-SVN-Rev: 32031 --- diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp index 8cbf7a3f9c9..2f84aba5c48 100644 --- a/icu4c/source/common/uloc.cpp +++ b/icu4c/source/common/uloc.cpp @@ -1700,8 +1700,8 @@ _canonicalize(const char* localeID, len+=cntrySize; } if(_isIDSeparator(*tmpLocaleID)) { - /* If there is something else, then we add the _ if we found country before.*/ - if (cntrySize > 0 ) { + /* If there is something else, then we add the _ if we found country before. */ + if (cntrySize >= 0 && ! _isIDSeparator(*(tmpLocaleID+1)) ) { ++fieldCount; if(len