mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:29:55 +00:00
Fix incompatible encoding names in ContentModel (bug uncovered by 41c17bccb6
)
This commit is contained in:
parent
f9a39138cc
commit
4d39d77eaa
2 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,7 @@ ContentSelectorModel::ContentModel::ContentModel(QObject *parent) :
|
|||
|
||||
void ContentSelectorModel::ContentModel::setEncoding(const QString &encoding)
|
||||
{
|
||||
mEncoding = encoding;
|
||||
if (encoding == QLatin1String("win1252"))
|
||||
mCodec = QTextCodec::codecForName("windows-1252");
|
||||
|
||||
|
@ -449,7 +450,7 @@ void ContentSelectorModel::ContentModel::addFiles(const QString &path)
|
|||
try {
|
||||
ESM::ESMReader fileReader;
|
||||
ToUTF8::Utf8Encoder encoder =
|
||||
ToUTF8::calculateEncoding(QString(mCodec->name()).toStdString());
|
||||
ToUTF8::calculateEncoding(mEncoding.toStdString());
|
||||
fileReader.setEncoder(&encoder);
|
||||
fileReader.open(dir.absoluteFilePath(path).toStdString());
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace ContentSelectorModel
|
|||
ContentFileList mFiles;
|
||||
QHash<QString, Qt::CheckState> mCheckStates;
|
||||
QTextCodec *mCodec;
|
||||
QString mEncoding;
|
||||
|
||||
public:
|
||||
|
||||
|
|
Loading…
Reference in a new issue