PIString and PIChar fixes 4
This commit is contained in:
@@ -339,7 +339,7 @@ PIChar PIChar::toUpper() const {
|
||||
UChar c(0);
|
||||
UErrorCode e((UErrorCode)0);
|
||||
u_strToUpper(&c, 1, (const UChar*)(&ch), 1, 0, &e);
|
||||
return PIChar(c);
|
||||
return PIChar((ushort)c);
|
||||
#else
|
||||
# ifdef WINDOWS
|
||||
ushort wc = 0;
|
||||
@@ -357,7 +357,7 @@ PIChar PIChar::toLower() const {
|
||||
UChar c(0);
|
||||
UErrorCode e((UErrorCode)0);
|
||||
u_strToLower(&c, 1, (const UChar*)(&ch), 1, 0, &e);
|
||||
return PIChar(c);
|
||||
return PIChar((ushort)c);
|
||||
#else
|
||||
# ifdef WINDOWS
|
||||
ushort wc = 0;
|
||||
|
||||
@@ -263,12 +263,12 @@ void PIString::appendFromChars(const char * c, int s, const char * codepage) {
|
||||
UChar * ucs = new UChar[s];
|
||||
memset(ucs, 0, s * sizeof(UChar));
|
||||
e = (UErrorCode)0;
|
||||
int sz = ucnv_toUChars(cc, ucs, s, c, s, &e);
|
||||
sz = ucnv_toUChars(cc, ucs, s, c, s, &e);
|
||||
//printf("appendFromChars %d -> %d\n", s, sz);
|
||||
//printf("PIString %d -> %d\n", c[0], ucs[0]);
|
||||
reserve(size_s() + sz);
|
||||
for (int i = 0; i < sz; ++i) {
|
||||
push_back(PIChar(ucs[i]));
|
||||
push_back(PIChar((ushort)ucs[i]));
|
||||
}
|
||||
delete[] ucs;
|
||||
ucnv_close(cc);
|
||||
|
||||
Reference in New Issue
Block a user