diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-05 17:16:26 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-05 17:16:26 +0000 |
commit | cc66392570a0f78eb8fcb21de51fc7b9fc26c604 (patch) | |
tree | d250de819e54c6bd514a34f2f2cdde830b6e94bd /src/tag.c | |
parent | c21084d9659dd70ca33854316b15d16e26bbde6a (diff) | |
download | mpd-cc66392570a0f78eb8fcb21de51fc7b9fc26c604.tar.gz mpd-cc66392570a0f78eb8fcb21de51fc7b9fc26c604.tar.xz mpd-cc66392570a0f78eb8fcb21de51fc7b9fc26c604.zip |
apply dottemag's id3v1 encodings patch
git-svn-id: https://svn.musicpd.org/mpd/trunk@2163 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -23,6 +23,8 @@ #include "utf8.h" #include "log.h" #include "inputStream.h" +#include "conf.h" +#include "charConv.h" #include <sys/stat.h> #include <stdlib.h> @@ -91,6 +93,18 @@ char * getID3Info(struct id3_tag * tag, char * id) { utf8 = id3_ucs4_utf8duplicate(ucs4); if(!utf8) return NULL; + if(getConf()[CONF_ID3V1_ENCODING] + && (id3_tag_options(tag, 0, 0) & ID3_TAG_OPTION_ID3V1)) { + + char* isostr; + setCharSetConversion("ISO-8859-1", "UTF-8"); + isostr = convStrDup(utf8); + free(utf8); + setCharSetConversion("UTF-8", getConf()[CONF_ID3V1_ENCODING]); + utf8 = convStrDup(isostr); + free(isostr); + } + return utf8; } #endif |