mapper: apply filesystem_charset to playlists
This fixes an inconsistency in the stored playlist subsystem: when obtaining the list of playlists (listplaylist, listplaylistinfo), the file names in the playlist directory are converted to UTF-8 (according to filesystem_charset), but when saving or loading playlists, the filesystem_charset setting was ignored.
This commit is contained in:
13
src/mapper.c
13
src/mapper.c
@@ -221,14 +221,19 @@ map_spl_path(void)
|
||||
char *
|
||||
map_spl_utf8_to_fs(const char *name)
|
||||
{
|
||||
char *filename, *path;
|
||||
char *filename_utf8, *filename_fs, *path;
|
||||
|
||||
if (playlist_dir == NULL)
|
||||
return NULL;
|
||||
|
||||
filename = g_strconcat(name, PLAYLIST_FILE_SUFFIX, NULL);
|
||||
path = g_build_filename(playlist_dir, filename, NULL);
|
||||
g_free(filename);
|
||||
filename_utf8 = g_strconcat(name, PLAYLIST_FILE_SUFFIX, NULL);
|
||||
filename_fs = utf8_to_fs_charset(filename_utf8);
|
||||
g_free(filename_utf8);
|
||||
if (filename_fs == NULL)
|
||||
return NULL;
|
||||
|
||||
path = g_build_filename(playlist_dir, filename_fs, NULL);
|
||||
g_free(filename_fs);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
Reference in New Issue
Block a user