Commit 32c76b46 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to fix encoding problem

CCBUG: 416758
CCBUG: 418161
parent 7c42ba46
......@@ -73,6 +73,7 @@ void WebEnginePartHtmlWriter::end()
mTempFile->open();
QTextStream stream(mTempFile);
//TODO we need to change codec when mail use different codec.
//stream.setCodec(codec().constData());
stream.setCodec("UTF-8");
stream << data();
......
......@@ -65,3 +65,13 @@ QTextStream *HtmlWriter::stream() const
{
return m_stream.get();
}
void HtmlWriter::setCodec(const QByteArray &codec)
{
mCodec = codec;
}
QByteArray HtmlWriter::codec() const
{
return mCodec;
}
......@@ -37,8 +37,7 @@
#include <qglobal.h>
#include <memory>
class QByteArray;
#include <QByteArray>
class QIODevice;
class QString;
class QTextStream;
......@@ -96,8 +95,11 @@ public:
virtual void extraHead(const QString &str) = 0;
void setCodec(const QByteArray &codec);
Q_REQUIRED_RESULT QByteArray codec() const;
private:
Q_DISABLE_COPY(HtmlWriter)
QByteArray mCodec = QByteArrayLiteral("UTF-8");
mutable std::unique_ptr<QTextStream> m_stream;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment