add character set conversion
This commit is contained in:
parent
2ffb32bcb4
commit
abe92a3135
2
Makefile
2
Makefile
|
@ -28,7 +28,7 @@ WARN=-pedantic -Wall -W -Wnested-externs -Wpointer-arith -Wno-long-long
|
||||||
PLATFORM=$(shell uname -s | cut -d- -f1)
|
PLATFORM=$(shell uname -s | cut -d- -f1)
|
||||||
ifeq ($(PLATFORM),Linux)
|
ifeq ($(PLATFORM),Linux)
|
||||||
DEFS=-DHAVE_SQLITE3
|
DEFS=-DHAVE_SQLITE3
|
||||||
LIBS=-lsqlite3
|
LIBS=-lsqlite3 -lxconv
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: tags epg
|
all: tags epg
|
||||||
|
|
1
lint.h
1
lint.h
|
@ -23,6 +23,7 @@ char *ctime_nl(time_t *);
|
||||||
time_t mjd(uint16_t, int, int, int);
|
time_t mjd(uint16_t, int, int, int);
|
||||||
void safeprintf(char *, ...);
|
void safeprintf(char *, ...);
|
||||||
void uncompress_epg(char **, unsigned int *);
|
void uncompress_epg(char **, unsigned int *);
|
||||||
|
void iso6937_convert(char **, unsigned int *);
|
||||||
|
|
||||||
struct epg *open_file(char *);
|
struct epg *open_file(char *);
|
||||||
void close_file(struct epg *);
|
void close_file(struct epg *);
|
||||||
|
|
9
main.c
9
main.c
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Humax EPG Tool
|
* Humax EPG Tool
|
||||||
* by af123, 2011 - 2016
|
* by af123, 2011 - 2017
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
#include "lint.h"
|
#include "lint.h"
|
||||||
|
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
const char *version = "1.2.4";
|
const char *version = "1.2.6";
|
||||||
unsigned long sysopts = 0;
|
unsigned long sysopts = 0;
|
||||||
unsigned long filterflags = 0;
|
unsigned long filterflags = 0;
|
||||||
static time_t latest_stamp = 0;
|
static time_t latest_stamp = 0;
|
||||||
|
@ -34,7 +34,7 @@ sqlite3_stmt *stmt;
|
||||||
int
|
int
|
||||||
syntax()
|
syntax()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Humax EPG Tool v%s, by af123, 2011-2016.\n\n",
|
fprintf(stderr, "Humax EPG Tool v%s, by af123, 2011-2017.\n\n",
|
||||||
version);
|
version);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Syntax: epg [options] [filters] <command>...\n\n");
|
"Syntax: epg [options] [filters] <command>...\n\n");
|
||||||
|
@ -320,6 +320,9 @@ sqlitedump(struct epg *epg __attribute__((unused)),
|
||||||
DECOMPRESS(d->content.d77.name, d->content.d77.namelen);
|
DECOMPRESS(d->content.d77.name, d->content.d77.namelen);
|
||||||
DECOMPRESS(d->content.d77.text, d->content.d77.textlen);
|
DECOMPRESS(d->content.d77.text, d->content.d77.textlen);
|
||||||
|
|
||||||
|
iso6937_convert(&d->content.d77.name, &d->content.d77.namelen);
|
||||||
|
iso6937_convert(&d->content.d77.text, &d->content.d77.textlen);
|
||||||
|
|
||||||
sqlite3_bind_text(stmt, 6, d->content.d77.name, -1, NULL);
|
sqlite3_bind_text(stmt, 6, d->content.d77.name, -1, NULL);
|
||||||
sqlite3_bind_text(stmt, 7, d->content.d77.text, -1, NULL);
|
sqlite3_bind_text(stmt, 7, d->content.d77.text, -1, NULL);
|
||||||
}
|
}
|
||||||
|
|
17
util.c
17
util.c
|
@ -13,6 +13,7 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <xconv.h>
|
||||||
|
|
||||||
#include "lint.h"
|
#include "lint.h"
|
||||||
|
|
||||||
|
@ -32,6 +33,22 @@ uncompress_epg(char **epg, unsigned int *epglen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
iso6937_convert(char **str, unsigned int *len)
|
||||||
|
{
|
||||||
|
char dst[0x200];
|
||||||
|
int newlen;
|
||||||
|
|
||||||
|
newlen = xconv(*str, dst, sizeof(dst));
|
||||||
|
|
||||||
|
if (newlen)
|
||||||
|
{
|
||||||
|
free(*str);
|
||||||
|
*str = strdup(dst);
|
||||||
|
*len = newlen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef sun
|
#ifdef sun
|
||||||
char *
|
char *
|
||||||
strcasestr (char *h, char *n)
|
strcasestr (char *h, char *n)
|
||||||
|
|
Loading…
Reference in New Issue