Skip to content

Commit

Permalink
Merge pull request #4957 from xavi-b/master
Browse files Browse the repository at this point in the history
Fix MacOS UTF-8 normalization issue
  • Loading branch information
claucambra authored Apr 24, 2023
2 parents e57fd7d + 5113802 commit 4429635
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/common/syncjournaldb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,15 @@ QVector<QByteArray> SyncJournalDb::tableColumns(const QByteArray &table)

qint64 SyncJournalDb::getPHash(const QByteArray &file)
{
QByteArray bytes = file;
#ifdef Q_OS_MAC
bytes = QString::fromUtf8(file).normalized(QString::NormalizationForm_C).toUtf8();
#endif

qint64 h = 0;
int len = file.length();
int len = bytes.length();

h = c_jhash64((uint8_t *)file.data(), len, 0);
h = c_jhash64((uint8_t *)bytes.data(), len, 0);
return h;
}

Expand Down

0 comments on commit 4429635

Please sign in to comment.