mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-329 donot use deprecated getUChars() API
X-SVN-Rev: 5517
This commit is contained in:
parent
0d5628b0bb
commit
5ee3959414
3 changed files with 13 additions and 7 deletions
|
@ -244,7 +244,7 @@ ChoiceFormat::stod(const UnicodeString& string,
|
|||
|
||||
char source[256] = { '\0' };
|
||||
char* end;
|
||||
u_UCharsToChars(string.getUChars(),source,string.length());
|
||||
string.extract(0,string.length(),source,256,""/*default codepage*/);
|
||||
return uprv_strtod(source,&end);
|
||||
}
|
||||
|
||||
|
|
|
@ -826,7 +826,8 @@ umsg_vformat( UMessageFormat *fmt,
|
|||
*status = U_BUFFER_OVERFLOW_ERROR;
|
||||
}else{
|
||||
/* copy the resultStr to target buffer */
|
||||
u_strcpy(result, resultStr.getUChars());
|
||||
//u_strcpy(result, resultStr.getUChars());
|
||||
resultStr.extract(0,resultStr.length(),result,0);
|
||||
}
|
||||
return resultStr.length();
|
||||
}
|
||||
|
@ -897,7 +898,8 @@ umsg_vparse(UMessageFormat *fmt,
|
|||
case Formattable::kString:
|
||||
aString = va_arg(ap, UChar*);
|
||||
args[i].getString(temp);
|
||||
u_strcpy(aString, temp.getUChars());
|
||||
//u_strcpy(aString, temp.getUChars());
|
||||
temp.extract(0,temp.length(),aString);
|
||||
break;
|
||||
|
||||
// better not happen!
|
||||
|
|
|
@ -603,12 +603,14 @@ unum_getSymbols(const UNumberFormat* fmt,
|
|||
|
||||
dfs->getCurrencySymbol(temp);
|
||||
len = uprv_min(temp.length(), UNFSYMBOLSMAXSIZE);
|
||||
u_strncpy(syms->currency, temp.getUChars(), len);
|
||||
//u_strncpy(syms->currency, temp.getUChars(), len);
|
||||
temp.extract(0,len,syms->currency);
|
||||
syms->currency[len > 0 ? len : 0] = 0x0000;
|
||||
|
||||
dfs->getInternationalCurrencySymbol(temp);
|
||||
len = uprv_min(temp.length(), UNFSYMBOLSMAXSIZE);
|
||||
u_strncpy(syms->intlCurrency, temp.getUChars(), len);
|
||||
//u_strncpy(syms->intlCurrency, temp.getUChars(), len);
|
||||
temp.extract(0,len,syms->intlCurrency);
|
||||
syms->intlCurrency[len > 0 ? len : 0] = 0x0000;
|
||||
|
||||
syms->monetarySeparator = dfs->getMonetaryDecimalSeparator();
|
||||
|
@ -618,12 +620,14 @@ unum_getSymbols(const UNumberFormat* fmt,
|
|||
|
||||
dfs->getInfinity(temp);
|
||||
len = uprv_min(temp.length(), UNFSYMBOLSMAXSIZE);
|
||||
u_strncpy(syms->infinity, temp.getUChars(), len);
|
||||
//u_strncpy(syms->infinity, temp.getUChars(), len);
|
||||
temp.extract(0,len,syms->infinity);
|
||||
syms->infinity[len > 0 ? len : 0] = 0x0000;
|
||||
|
||||
dfs->getNaN(temp);
|
||||
len = uprv_min(temp.length(), UNFSYMBOLSMAXSIZE);
|
||||
u_strncpy(syms->naN, temp.getUChars(), len);
|
||||
//u_strncpy(syms->naN, temp.getUChars(), len);
|
||||
temp.extract(0,len,syms->naN);
|
||||
syms->naN[len > 0 ? len : 0] = 0x0000;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue