git-svn-id: svn://db.shs.com.ru/pip@255 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -38,14 +38,15 @@ char * __sysoemname__ = 0;
|
||||
*/
|
||||
|
||||
|
||||
PIChar::PIChar(const char * c) {
|
||||
PIChar::PIChar(const char * c, int * bytes) {
|
||||
#ifdef PIP_ICU
|
||||
UErrorCode e((UErrorCode)0);
|
||||
UConverter * cc = ucnv_open(__syslocname__, &e);
|
||||
if (cc) {
|
||||
UChar uc;
|
||||
e = (UErrorCode)0;
|
||||
ucnv_toUChars(cc, &uc, 1, c, 4, &e);
|
||||
int ret = ucnv_toUChars(cc, &uc, 1, c, 4, &e);
|
||||
if (bytes) * bytes = ret;
|
||||
ucnv_close(cc);
|
||||
ch = uc;
|
||||
return;
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
PIChar(const uint c = 0) {ch = c;}
|
||||
|
||||
//! Contructs symbol from no more than 4 bytes of string
|
||||
PIChar(const char * c);
|
||||
PIChar(const char * c, int * bytes = 0);
|
||||
|
||||
//inline operator const int() {return static_cast<const int>(ch);}
|
||||
//inline operator const char() {return toAscii();}
|
||||
|
||||
Reference in New Issue
Block a user