mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Using UTF-8 when reading files.
This commit is contained in:
parent
0e12433c0e
commit
b0f209b1da
@ -769,7 +769,7 @@ QUrl MainApplication::userStyleSheet(const QString &filePath) const
|
||||
|
||||
QFile file(filePath);
|
||||
if (!filePath.isEmpty() && file.open(QFile::ReadOnly)) {
|
||||
QString fileData = file.readAll();
|
||||
QString fileData = QString::fromUtf8(file.readAll());
|
||||
fileData.remove('\n');
|
||||
userStyle.append(fileData);
|
||||
file.close();
|
||||
|
@ -50,11 +50,11 @@ QPixmap qz_pixmapFromByteArray(const QByteArray &data)
|
||||
return image;
|
||||
}
|
||||
|
||||
QByteArray qz_readAllFileContents(const QString &filename)
|
||||
QString qz_readAllFileContents(const QString &filename)
|
||||
{
|
||||
QFile file(filename);
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
QByteArray a = file.readAll();
|
||||
QString a = QString::fromUtf8(file.readAll());
|
||||
file.close();
|
||||
return a;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class QUrl;
|
||||
QByteArray QT_QUPZILLA_EXPORT qz_pixmapToByteArray(const QPixmap &pix);
|
||||
QPixmap QT_QUPZILLA_EXPORT qz_pixmapFromByteArray(const QByteArray &data);
|
||||
|
||||
QByteArray QT_QUPZILLA_EXPORT qz_readAllFileContents(const QString &filename);
|
||||
QString qz_readAllFileContents(const QString &filename);
|
||||
|
||||
void QT_QUPZILLA_EXPORT qz_centerWidgetOnScreen(QWidget* w);
|
||||
void QT_QUPZILLA_EXPORT qz_centerWidgetToParent(QWidget* w, QWidget* parent);
|
||||
|
Loading…
Reference in New Issue
Block a user