From 4febbcddfe56a93e03b263e13f9292f0af2202df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Wed, 10 Aug 2016 11:13:23 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@218 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/core/pistring.cpp | 2 ++ src/io/piconfig.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/core/pistring.cpp b/src/core/pistring.cpp index 58cdb9a8..e3948881 100755 --- a/src/core/pistring.cpp +++ b/src/core/pistring.cpp @@ -285,6 +285,7 @@ const char * PIString::dataAscii() const { PIByteArray PIString::toUTF8() const { + if (isEmpty()) return data_.resized(0); buildData( #ifdef PIP_ICU "UTF-8" @@ -295,6 +296,7 @@ PIByteArray PIString::toUTF8() const { PIByteArray PIString::toCharset(const char * c) const { + if (isEmpty()) return data_.resized(0); buildData( #ifdef PIP_ICU c diff --git a/src/io/piconfig.cpp b/src/io/piconfig.cpp index f225fd37..a6b95ed3 100755 --- a/src/io/piconfig.cpp +++ b/src/io/piconfig.cpp @@ -693,6 +693,7 @@ PIString PIConfig::parseLine(PIString v) { void PIConfig::parse() { + //piCout << "[PIConfig] charset" << PIFile::defaultCharset(); PIString src, str, tab, comm, all, name, type, prefix, tprefix; PIStringList tree; Entry * entry, * te, * ce; @@ -719,6 +720,7 @@ void PIConfig::parse() { tab = str.left(str.find(str.trimmed().left(1))); str.trim(); //cout << endl << str << endl << endl; +// piCout << "[PIConfig] str" << str.size() << str << str.toUTF8(); all = str; ind = str.find('='); if ((ind > 0) && (str[0] != '#')) { @@ -778,6 +780,8 @@ void PIConfig::parse() { ce->_value = str.right(str.length() - ind - 1).trimmed(); ce->_type = type; ce->_comment = comm; + //piCout << "[PIConfig] comm" << comm.size() << comm << comm.toUTF8(); + //piCout << "[PIConfig] type" << type.size() << type << type.toUTF8(); ce->_line = lines; ce->_all = all; if (isNew) {