Replace non-translated characters with underscore

This commit is contained in:
Jonas Kvinge 2022-02-04 19:07:15 +01:00
parent 40f381257d
commit 3acbe431f7
2 changed files with 2 additions and 1 deletions

View File

@ -823,6 +823,7 @@ QString UnicodeToAscii(QString unicode) {
iconv_close(conv);
QString ret(output_ptr);
ret = ret.replace('?', '_');
delete[] input_ptr;
delete[] output_ptr;

View File

@ -177,7 +177,7 @@ TEST_F(OrganizeFormatTest, ReplaceNonAscii) {
EXPECT_EQ("Royksopp", format_.GetFilenameForSong(song_));
song_.set_artist(QString::fromUtf8("Владимир Высоцкий"));
EXPECT_EQ("????????_????????", format_.GetFilenameForSong(song_));
EXPECT_EQ("_________________", format_.GetFilenameForSong(song_));
}