PIString and PIChar fixes 4

This commit is contained in:
Andrey
2022-03-25 15:10:29 +03:00
parent 7dee8f6313
commit 4c7df57e66
3 changed files with 27 additions and 28 deletions

View File

@@ -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);