Add config option latin1_tags to fix utf-8 tags in text fields purporting to be latin1. Sadly, this is an all-or-nothing option. Perhaps one could autodetect?

This commit is contained in:
Ron Pedde 2005-02-24 05:04:05 +00:00
parent 62ce3c8fb7
commit ecaae83ce5
3 changed files with 8 additions and 1 deletions

View File

@ -112,6 +112,7 @@ CONFIGELEMENT config_elements[] = {
{ 1,1,0,CONFIG_TYPE_STRING,"servername",(void*)&config.servername,config_emit_string },
{ 1,0,0,CONFIG_TYPE_INT,"rescan_interval",(void*)&config.rescan_interval,config_emit_int },
{ 1,0,0,CONFIG_TYPE_INT,"always_scan",(void*)&config.always_scan,config_emit_int },
{ 1,0,0,CONFIG_TYPE_INT,"latin1_tags",(void*)&config.latin1_tags,config_emit_int },
{ 1,0,0,CONFIG_TYPE_INT,"process_m3u",(void*)&config.process_m3u,config_emit_int },
{ 1,0,0,CONFIG_TYPE_INT,"scan_type",(void*)&config.scan_type,config_emit_int },
{ 1,0,0,CONFIG_TYPE_INT,"compress",(void*)&config.compress,config_emit_int },
@ -274,6 +275,7 @@ int config_read(char *file) {
config.process_m3u=0;
config.scan_type=0;
config.compress=0;
config.latin1_tags=0;
/* DWB: use alloced space so it can be freed without errors */
config.extensions=strdup(".mp3");

View File

@ -56,6 +56,7 @@ typedef struct tag_config {
int scan_type; /**< How hard to search mp3 files. see scan_get_mp3fileinfo() */
int compress; /**< Should we compress? */
int pid; /**< pid that will accept INT to terminate */
int latin1_tags; /**< interpret all tags as latin1 rather than utf8 */
char *adminpassword; /**< Password to web management pages */
char *readpassword; /**< iTunes password */
char *mp3dir; /**< root directory of the mp3 files */

View File

@ -800,7 +800,11 @@ int scan_get_mp3tags(char *file, MP3FILE *pmp3) {
if(native_text) {
have_utf8=1;
utf8_text=id3_ucs4_utf8duplicate(native_text);
if(config.latin1_tags) {
utf8_text=id3_ucs4_latin1duplicate(native_text);
} else {
utf8_text=id3_ucs4_utf8duplicate(native_text);
}
MEMNOTIFY(utf8_text);
if(!strcmp(pid3frame->id,"TIT2")) { /* Title */