diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/conf.c | 5 | ||||
-rw-r--r-- | src/conf.h | 1 | ||||
-rw-r--r-- | src/tag.c | 14 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/conf.c b/src/conf.c index 7850c8881..d61d638bf 100644 --- a/src/conf.c +++ b/src/conf.c @@ -37,7 +37,7 @@ #define CONF_COMMENT '#' -#define CONF_NUMBER_OF_PARAMS 41 +#define CONF_NUMBER_OF_PARAMS 42 #define CONF_NUMBER_OF_PATHS 6 #define CONF_NUMBER_OF_REQUIRED 5 #define CONF_NUMBER_OF_ALLOW_CATS 1 @@ -137,7 +137,8 @@ char ** readConf(char * file) { "shout_mount", "shout_name", "shout_user", - "shout_quality" + "shout_quality", + "id3v1_encoding" }; int conf_absolutePaths[CONF_NUMBER_OF_PATHS] = { diff --git a/src/conf.h b/src/conf.h index 56ea0cc44..d87dc24fc 100644 --- a/src/conf.h +++ b/src/conf.h @@ -62,6 +62,7 @@ #define CONF_SHOUT_NAME 38 #define CONF_SHOUT_USER 39 #define CONF_SHOUT_QUALITY 40 +#define CONF_ID3V1_ENCODING 41 #define CONF_CAT_CHAR "\n" @@ -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 |