Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62011

QString::fromUcs4() eats ZERO WIDTH NO-BREAK SPACE

    XMLWordPrintable

Details

    • 1c0b69eac521fec074390c023be8b5a23e88dd50 (qt/qtbase/5.14)

    Description

      QString::fromUcs4() internally calls Utf32::convertToUnicode(), which defaults to detect endianess from the data (which eats leading BOM).

      But QString::fromUcs4() always uses the machine endianess, so no header parsing is needed.

      I suggest to call it with QTextCodec::IgnoreHeader flag set.

      Test case:

      uint chr = 0xFEFF;
      qDebug << QString::fromUcs4(&chr, 1).toUtf8();

      shows an empty QByteArray.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Eddy Edward Welbourne
            cfeck Christoph Feck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes