[Webkit-unassigned] [Bug 46251] [Qt] Some Unicode tests fail with Qt version >= 4.7.0

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 21 08:08:22 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=46251





--- Comment #3 from Joe Wild <joseph.wild at nokia.com>  2011-03-21 08:08:22 PST ---
This doesn't seem to be an error, but it is different behavior on Qt than
on other platforms.

Turns out that QString.toUtf8 converts reserved (non character) values
like 0xFFFF to a replacement character of '?' (0x3f).

Not sure if we want to change these tests or make separate test results for 
Qt.  Seems better to me to have a definite char in the output, like '?' than
to rely on how 0xFFFF will be displayed and/or diffed.

/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
void DumpRenderTree::dump()
{
...
        QString markup = mainFrame->toHtml();
        fprintf(stdout, "Source:\n\n%s\n", markup.toUtf8().constData());


So it looks like toUtf8 converts 0xFFFF to '?',
which is as specified for toUtf8.

QByteArray QString::toUtf8 () const
e
Returns a UTF-8 representation of the string as a QByteArray.

UTF-8 is a Unicode codec and can represent all characters in a Unicode
string like QString.

However, in the Unicode range, there are certain codepoints that are
not considered characters. The Unicode standard reserves the last two
codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF,
inclusive, as non-characters. If any of those appear in the string,
they may be discarded and will not appear in the UTF-8 representation,
or they may be replaced by one or more replacement characters.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list