diff -rcw epgdumpr2.old/eit.c epgdumpr2/eit.c *** epgdumpr2.old/eit.c 2009-03-15 12:57:34.000000000 +0900 --- epgdumpr2/eit.c 2009-03-15 19:02:33.151913634 +0900 *************** *** 4,9 **** --- 4,17 ---- #include "eit.h" + char *subtitle_cnv_str[] = { + " 第", + " 「", + " #", + "(", + "「", + NULL + }; static void timecmp(int *,int *,int *, int, int, int); *************** *** 249,254 **** --- 257,284 ---- } return NULL ; } + void conv_title_subtitle(EIT_CONTROL *eitptr) + { + int lp = 0 ; + size_t addsize ; + char *ptr ; + char *newsubtitle ; + + for(lp = 0 ; subtitle_cnv_str[lp] != NULL ; lp++){ + ptr = strstr(eitptr->title, subtitle_cnv_str[lp]); + if(ptr == NULL){ + continue ; + } + newsubtitle = calloc(1, ((strlen(ptr) + 1) + (strlen(eitptr->subtitle) + 1))); + memcpy(newsubtitle, ptr, strlen(ptr)); + newsubtitle[strlen(ptr)] = ' '; + *ptr = NULL ; + strcat(newsubtitle, eitptr->subtitle); + free(eitptr->subtitle); + eitptr->subtitle = newsubtitle ; + return ; + } + } void enqueue(EIT_CONTROL *top, EIT_CONTROL *eitptr) { EIT_CONTROL *cur ; *************** *** 278,283 **** --- 308,314 ---- } cur->prev = eitptr ; eitptr->next = cur ; + conv_title_subtitle(eitptr); return ; } } *************** *** 288,298 **** --- 319,331 ---- } cur->prev = eitptr ; eitptr->next = cur ; + conv_title_subtitle(eitptr); return ; } if(cur->next == NULL){ cur->next = eitptr ; eitptr->prev = cur ; + conv_title_subtitle(eitptr); return ; } cur = cur->next ; *************** *** 371,376 **** --- 404,410 ---- cur->event_id = eitb.event_id ; cur->servid = eith.service_id ; cur->title = calloc(1, (strlen(sevtd.event_name) + 1)); + memcpy(cur->title, sevtd.event_name, strlen(sevtd.event_name)); cur->subtitle = calloc(1, (strlen(sevtd.text) + 1)); memcpy(cur->subtitle, sevtd.text, strlen(sevtd.text)); diff -rcw epgdumpr2.old/epgdump.c epgdumpr2/epgdump.c *** epgdumpr2.old/epgdump.c 2009-03-15 14:26:22.000000000 +0900 --- epgdumpr2/epgdump.c 2009-03-15 17:28:53.355808722 +0900 *************** *** 212,217 **** --- 212,218 ---- olen = sizeof(title); inptr = eitcur->title; iconv(cd, &inptr, &ilen, &outptr, &olen); + xmlspecialchars(title); memset(subtitle, '\0', sizeof(subtitle)); ilen = strlen(eitcur->subtitle); *************** *** 219,225 **** outptr = subtitle ; inptr = eitcur->subtitle; iconv(cd, &inptr, &ilen, &outptr, &olen); ! xmlspecialchars(ServiceName); memset(Category, '\0', sizeof(Category)); ilen = strlen(ContentCatList[eitcur->content_type].japanese); --- 220,226 ---- outptr = subtitle ; inptr = eitcur->subtitle; iconv(cd, &inptr, &ilen, &outptr, &olen); ! xmlspecialchars(subtitle); memset(Category, '\0', sizeof(Category)); ilen = strlen(ContentCatList[eitcur->content_type].japanese); *************** *** 227,233 **** outptr = Category ; inptr = ContentCatList[eitcur->content_type].japanese; iconv(cd, &inptr, &ilen, &outptr, &olen); ! xmlspecialchars(ServiceName); tl.tm_sec = eitcur->ss ; tl.tm_min = eitcur->hm ; --- 228,234 ---- outptr = Category ; inptr = ContentCatList[eitcur->content_type].japanese; iconv(cd, &inptr, &ilen, &outptr, &olen); ! xmlspecialchars(Category); tl.tm_sec = eitcur->ss ; tl.tm_min = eitcur->hm ;