git-svn-id: svn://db.shs.com.ru/pip@584 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -88,7 +88,7 @@ const int PIString::fromBaseN[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -
|
|||||||
# define pisprintf(f, v) char ch[256]; memset(ch, 0, 256); sprintf_s(ch, 256, f, v);
|
# define pisprintf(f, v) char ch[256]; memset(ch, 0, 256); sprintf_s(ch, 256, f, v);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
|
//int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
|
||||||
#endif
|
#endif
|
||||||
PIString PIString::itos(const int num) {pisprintf("%d", num); return PIString(ch);}
|
PIString PIString::itos(const int num) {pisprintf("%d", num); return PIString(ch);}
|
||||||
PIString PIString::ltos(const long num) {pisprintf("%ld", num); return PIString(ch);}
|
PIString PIString::ltos(const long num) {pisprintf("%ld", num); return PIString(ch);}
|
||||||
@@ -215,12 +215,17 @@ void PIString::appendFromChars(const char * c, int s, const char * cp) {
|
|||||||
int sz;
|
int sz;
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
mbtowc(0,0,0); // reset mbtowc
|
mbtowc(0,0,0); // reset mbtowc
|
||||||
|
//qDebug() << "FromChars ...";
|
||||||
while (s>0) {
|
while (s>0) {
|
||||||
|
//qDebug() << "0" << s;
|
||||||
sz = mbtowc(&wc, c, s);
|
sz = mbtowc(&wc, c, s);
|
||||||
|
//qDebug() << "1" << sz;
|
||||||
if (sz < 1) break;
|
if (sz < 1) break;
|
||||||
push_back(PIChar(int(wc)));
|
push_back(PIChar(int(wc)));
|
||||||
c += sz; s -= sz;
|
c += sz; s -= sz;
|
||||||
|
//qDebug() << "2" << c;
|
||||||
}
|
}
|
||||||
|
//qDebug() << "FromChars done" << size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user