Commit 6217711a authored by Marian Ďurkovič's avatar Marian Ďurkovič

Set EPG default charset to ISO6937 as required by ETSI EN 300 468 Annex A

Also provide workarounds for some broadcasters which ignore this standard.
parent 697041f6
...@@ -374,6 +374,8 @@ struct demux_sys_t ...@@ -374,6 +374,8 @@ struct demux_sys_t
bool b_start_record; bool b_start_record;
}; };
static int i_broken_epg;
static int Demux ( demux_t *p_demux ); static int Demux ( demux_t *p_demux );
static int DemuxFile( demux_t *p_demux ); static int DemuxFile( demux_t *p_demux );
static int Control( demux_t *p_demux, int i_query, va_list args ); static int Control( demux_t *p_demux, int i_query, va_list args );
...@@ -2583,10 +2585,18 @@ static char *EITConvertToUTF8( const unsigned char *psz_instring, ...@@ -2583,10 +2585,18 @@ static char *EITConvertToUTF8( const unsigned char *psz_instring,
if( i_length < 1 ) return NULL; if( i_length < 1 ) return NULL;
if( psz_instring[0] >= 0x20 ) if( psz_instring[0] >= 0x20 )
{
/* According to ETSI EN 300 468 Annex A, this should be ISO6937,
* but some broadcasters use different charset... */
if ( i_broken_epg == 1 )
{ {
psz_encoding = "ISO_8859-1"; psz_encoding = "ISO_8859-1";
/* According to the specification, this should be ISO6937, }
* but it seems Latin-1 is used instead. */ else
{
psz_encoding = "ISO_6937";
}
offset = 0; offset = 0;
} }
else switch( psz_instring[0] ) else switch( psz_instring[0] )
...@@ -2720,6 +2730,8 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt ) ...@@ -2720,6 +2730,8 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
p_sdt->i_ts_id, p_sdt->i_version, p_sdt->b_current_next, p_sdt->i_ts_id, p_sdt->i_version, p_sdt->b_current_next,
p_sdt->i_network_id ); p_sdt->i_network_id );
i_broken_epg = 0;
for( p_srv = p_sdt->p_first_service; p_srv; p_srv = p_srv->p_next ) for( p_srv = p_sdt->p_first_service; p_srv; p_srv = p_srv->p_next )
{ {
vlc_meta_t *p_meta; vlc_meta_t *p_meta;
...@@ -2765,6 +2777,17 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt ) ...@@ -2765,6 +2777,17 @@ static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
char *str1 = NULL; char *str1 = NULL;
char *str2 = NULL; char *str2 = NULL;
/* Workarounds for broadcasters with broken EPG */
if ( p_sdt->i_network_id == 133 )
i_broken_epg = 1; /* SKY DE & BetaDigital use ISO8859-1 */
if ( !strncmp(pD->i_service_provider_name, "CSAT",
pD->i_service_provider_name_length) )
i_broken_epg = 1; /* CanalSat FR uses ISO8859-1 */
/* FIXME: Digital+ ES also uses ISO8859-1 */
str1 = EITConvertToUTF8(pD->i_service_provider_name, str1 = EITConvertToUTF8(pD->i_service_provider_name,
pD->i_service_provider_name_length); pD->i_service_provider_name_length);
str2 = EITConvertToUTF8(pD->i_service_name, str2 = EITConvertToUTF8(pD->i_service_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment