diff options
author | J. Alexander Treuman <jat@spatialrift.net> | 2006-06-21 20:52:51 +0000 |
---|---|---|
committer | J. Alexander Treuman <jat@spatialrift.net> | 2006-06-21 20:52:51 +0000 |
commit | 18306dfbd36d2d8bd13fc39eea0a3b703f2481ec (patch) | |
tree | 9978f211b72b6ecb2fa16c07d6d55483bce3c3bd /src/tag.c | |
parent | 9e393393e0b5ca1b2c85664b2a5f8e36d199a269 (diff) | |
download | mpd-18306dfbd36d2d8bd13fc39eea0a3b703f2481ec.tar.gz mpd-18306dfbd36d2d8bd13fc39eea0a3b703f2481ec.tar.xz mpd-18306dfbd36d2d8bd13fc39eea0a3b703f2481ec.zip |
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
Diffstat (limited to '')
-rw-r--r-- | src/tag.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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); |