case 'C':
C++ (Qt)for (int zz = 0; zz < nr; ++zz) { if(codec) *b = codec->fromUnicode( QString::fromUtf8(" ") ).at(0); else *b = QString::fromUtf8(" ").at(0).toLatin1(); b++; for(j = 0, p_fld = fld; j < dbfFieldCount; ++j, ++p_fld) { k = (unsigned short) p_fld->fieldLen[0]; QString myString = myModel->record(zz).value(j).toString();//row = zz; column=j; if(myString.isNull()) str = QString(k, QString::fromUtf8(" ").at(0)); else switch(p_fld->fieldType) { case 'D': //str = Fields->Fields[j]->toDate().toString("yyyyMMdd"); break; case 'N': //str = QString::number(Fields->Fields[j]->toDouble(), 'f', 0 - Fields->Fields[j]->sqlScale()); if(str.length() > k) str.resize( k ); else str = QString(k - str.length(), QString::fromUtf8(" ").at(0)) + str; break; case 'C': str = myString; case 'L': //str = Fields->Fields[j]->toString(); //if(str.length() > k) str.resize( k ); //else str += QString(k - str.length(), QString::fromUtf8(" ").at(0)); break; } if(codec) str = codec->fromUnicode( str ); memcpy(b, str.toLatin1().data(), k); b += k; } ++i; if(i == recordCountDbfPortion) { fileStream.writeRawData(buf, i * hdr->recordSize); i = 0; b = buf; } }
C++ (Qt)QTextCodec::codecForName("IBM 866");
if(myString.isNull()) str = QString(k, QString::fromUtf8(" ").at(0));
if(codec == QTextCodec::codecForName("CP1251")) hdr->codePage = (unsigned char) 0x57; else if(codec == QTextCodec::codecForName("CP866")) hdr->codePage = (unsigned char) 0x26;
saveToDBF(fileName, QTextCodec::codecForName("CP866"));
case 'C': str = myString;case 'L': //str = Fields->Fields[j]->toString(); //if(str.length() > k) str.resize( k ); //else str += QString(k - str.length(), QString::fromUtf8(" ").at(0));break;
case 'C': case 'L': str = myString; if(str.length() > k) str.resize( k ); else str += QString(k - str.length(), QString::fromUtf8(" ").at(0));break;