From 18306dfbd36d2d8bd13fc39eea0a3b703f2481ec Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Wed, 21 Jun 2006 20:52:51 +0000 Subject: Add back the id3v1_encoding option. Now it really will convert id3v1 only. git-svn-id: https://svn.musicpd.org/mpd/trunk@4282 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/tag.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index aaf9a2d57..44a174c33 100644 --- a/src/tag.c +++ b/src/tag.c @@ -138,6 +138,8 @@ MpdTag * getID3Info(struct id3_tag * tag, char * id, int type, MpdTag * mpdTag) union id3_field const * field; unsigned int nstrings; int i; + char * isostr; + char * encoding; frame = id3_tag_findframe(tag, id, 0); if(!frame || frame->nfields < 2) return mpdTag; @@ -154,6 +156,18 @@ MpdTag * getID3Info(struct id3_tag * tag, char * id, int type, MpdTag * mpdTag) utf8 = id3_ucs4_utf8duplicate(ucs4); if(!utf8) continue; + if(isId3v1(tag)) { + encoding = getConfigParamValue(CONF_ID3V1_ENCODING); + if(encoding) { + setCharSetConversion("ISO-8859-1", "UTF-8"); + isostr = convStrDup(utf8); + free(utf8); + setCharSetConversion("UTF-8", encoding); + utf8 = convStrDup(isostr); + free(isostr); + } + } + if(mpdTag == NULL) mpdTag = newMpdTag(); addItemToMpdTag(mpdTag, type, utf8); -- cgit v1.2.3