ICU-3857 Update as per reviewer comments.

X-SVN-Rev: 16692
This commit is contained in:
George Rhoten 2004-11-01 17:41:49 +00:00
parent f7b99944d9
commit 7bbfff8f0b

View File

@ -565,11 +565,12 @@ ucnv_getCCSID(const UConverter * converter,
ccsid = converter->sharedData->staticData->codepage;
if (ccsid == 0) {
/* Rare case. This is for cases like gb18030, which doesn't have an IBM cannonical */
/* Rare case. This is for cases like gb18030,
which doesn't have an IBM cannonical name, but does have an IBM alias. */
const char *standardName = ucnv_getStandardName(ucnv_getName(converter, err), "IBM", err);
if (U_SUCCESS(*err) && standardName) {
const char *ccsidStr = uprv_strchr(standardName, '-') + 1;
ccsid = (int32_t)atof(ccsidStr);
ccsid = (int32_t)atol(ccsidStr);
}
}
return ccsid;