Re: [Interest] Can't understand how to use QCborStreamReader/QCborStreamWriter

2022-05-19 Thread Alexander Dyagilev
Oh, OK, I should write them inside of array (i.e. use QCborStreamWriter::startArray). Sorry... xD On 5/20/2022 6:28 AM, Alexander Dyagilev wrote: Hello, I'm trying to write and read 2 byte arrays. Getting assertion failure when reading second array. Write: QByteArrayba; QCborStreamWriter

[Interest] Can't understand how to use QCborStreamReader/QCborStreamWriter

2022-05-19 Thread Alexander Dyagilev
Hello, I'm trying to write and read 2 byte arrays. Getting assertion failure when reading second array. Write: QByteArrayba; QCborStreamWriterw(&ba); QByteArraya1(10,'A'); QByteArraya2(10,'B'); w.append(a1); w.append(a2); Read: QByteArrayreadByteArray(QCborStreamReader&cbor) { Q_ASSER

Re: [Interest] QCborValue is not suitable for using in sockets data exchange?

2022-05-19 Thread Thiago Macieira
On Thursday, 19 May 2022 09:41:03 PDT Alexander Dyagilev wrote: > Hello, > > One can easily write it to socket. E.g. > > socket->write(value.toCbor()); > > But how to read it then? It seems it's not possible. I have yet to properly implement continued parsing with QCborValue. QCborStreamReader

[Interest] QCborValue is not suitable for using in sockets data exchange?

2022-05-19 Thread Alexander Dyagilev
Hello, One can easily write it to socket. E.g. socket->write(value.toCbor()); But how to read it then? It seems it's not possible. I.e. the following solution: MyClient::MyClient() {   QCborStreamReader cborReader = new QCborStreamReader(socket); } MyClient::onReadyRead() {    QCborValue

Re: [Interest] Using UTF-8 code page with Qt5 on Windows?

2022-05-19 Thread Thorsten Glaser
On Thu, 19 May 2022, Alvin Wong wrote: > > Windows were all DBCS. It might not be worth fixing the codec implementation > explicitly in docs that MBCS uses longer than 2 bytes per character, AIUI it is so that: • SBCS: all characters are one byte and one screen column • DBCS: all characters ar

Re: [Interest] Using UTF-8 code page with Qt5 on Windows?

2022-05-19 Thread Alvin Wong
Hi, > > This gave me an idea: perhaps the easiest way for Qt to fix it would > > be to check `GetACP() == CP_UTF8`, and if it is true then just use > > Qt's built-in UTF-8 support and bypass MultiByteToWideChar completely. > > Indeed. And given that the UTF-8 codec is highly optimised, it will be