Ensure mfi->title is proper UTF-8 when set to mfi->fname

This commit is contained in:
Julien BLACHE 2011-04-16 10:16:28 +02:00
parent a116e2ad1f
commit a981fa0a45

View File

@ -257,7 +257,14 @@ fixup_tags(struct media_file_info *mfi)
if (!mfi->genre)
mfi->genre = strdup("Unknown genre");
if (!mfi->title)
mfi->title = strdup(mfi->fname);
{
/* fname is left untouched by unicode_fixup_mfi() for
* obvious reasons, so ensure it is proper UTF-8
*/
mfi->title = unicode_fixup_string(mfi->fname);
if (mfi->title == mfi->fname)
mfi->title = strdup(mfi->fname);
}
/* Ensure sort tags are filled and normalized */
normalize_fixup_tag(&mfi->artist_sort, mfi->artist);