EPG Encoding

584 views
Skip to first unread message

netmaster

unread,
Sep 16, 2013, 7:54:52 AM9/16/13
to stalker-m...@googlegroups.com
As I understand, character encoding for EPG must be UTF-8.
Reality is, that EPG's from DVB-S or DVB-T is on non UTF encodings (ISO-8859-1, ISO-8859-5, etc.), often even several different encodings from the same source.
Is it possible to add "source encoding" option for every channel and use PHP's iconv function at import to convert EPG to UTF-8?

Aleksey Zhurbitsky

unread,
Sep 16, 2013, 9:18:14 AM9/16/13
to stalker-m...@googlegroups.com
As I understand, character encoding for EPG must be UTF-8.
Not exactly.

Is it possible to add "source encoding" option for every channel and use PHP's iconv function at import to convert EPG to UTF-8?
You can do all encoding conversion before adding it to the xmltv file. All text in the xmltv file must be in one encoding and this encoding must be specified in the xml header.
For example:
<?xml version="1.0" encoding="windows-1251"?>


netmaster

unread,
Sep 16, 2013, 3:00:11 PM9/16/13
to stalker-m...@googlegroups.com
yes, but what "must be" and what really is are two different things. I for example have EPG source, where in header is written ISO-8859-1, and german and english channels is on this encoding, but russian channels are actually in ISO-8859-5. If I convert all it from ISO-8859-1 to UTF-8 then russian part is ruined, if I convert from ISO-8859-5 to UTF-8, then german part is broken (some chars get replaced by cyrillic), etc. I did wrote program to convert every channel differently, but with many different sources and programs, this can be very unreliable and difficult to track where something happens. If on import time shifting and etc. can be done differently for every channels, why not re-encode it if necessary.

Aleksey Zhurbitsky

unread,
Sep 17, 2013, 10:24:36 AM9/17/13
to stalker-m...@googlegroups.com
You mean that in one xmltv file you have different encodings?

netmaster

unread,
Sep 17, 2013, 11:13:27 AM9/17/13
to stalker-m...@googlegroups.com
yes, exactly.
Because big providers usually supply users with own receivers (viasat for example) then they dont have any obligations to make EPG according to standards. Is enough to match with receiver firmware. Using tv_grab_dvb is very easy and free way (even for encrypted channels) to get EPG from the air, but encoding is always a mess especially for nonstandard characters like cyrillic ...

Aleksey Zhurbitsky

unread,
Sep 20, 2013, 5:06:00 AM9/20/13
to stalker-m...@googlegroups.com
Unfortunately, we can not help you. Encoding conversion is automatic according to the xml header.
I see only one way out - split the program into different files according to the encodings with an appropriate xml header.
Reply all
Reply to author
Forward
0 new messages