Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.8.0
-
None
-
macOS 10.12.3(16D32)Clang 7.0 (Apple), 64 bit
-
decac344458ddd45ec8f03d721d40795c7095404
Description
About the QOAuthHttpServerReplyHandler class specified in QOAuth1::setReplyHandler().
QOAuthHttpServerReplyHandler::setCallbackText() should be able to specify the contents of the response after the callback.
But, if you specify a Japanese text encoded in UTF-8 for this method, the display will be corrupted.
Probably, This is the same when one character uses characters composed of multiple bytes.
Default response is:
<html><head><title>Jugemutter</title></head><body>Callback received. Feel free to close this page.</body></html>
Code that causes problems:
auto *httpReplyHandler = new QOAuthHttpServerReplyHandler(this); httpReplyHandler->setCallbackText(”あ”);
That is response is (The last letter has been deleted):
<html><head><title>Jugemutter</title></head><body>あ</body></htm
Probably, caused by the following code:
src/qoauthhttpserverreplyhandler.cpp QOAuthHttpServerReplyHandlerPrivate::_q_answerClient()
const QByteArray htmlSize = QString::number(html.size()).toUtf8();
html.size() is number of characters, but correct is number of bytes.
Attachments
For Gerrit Dashboard: QTBUG-59725 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
189928,4 | Fix HTML response when using multibyte characters | 5.8 | qt/qtnetworkauth | Status: MERGED | +2 | 0 |