From a5921252942f73601b159f20b560477ec45b4ece Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 22 Apr 2007 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.5.2=20-=20Updated=20the=20Finnish=20OSD=20t?= =?UTF-8?q?exts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20handling?= =?UTF-8?q?=20user=20activity=20for=20shutdown,=20which=20I=20had=20messed?= =?UTF-8?q?=20when=20adopting=20Udo's=20=20=20original=20patch=20(thanks?= =?UTF-8?q?=20to=20Udo=20Richter).=20-=20Added=20Turkish=20language=20text?= =?UTF-8?q?s=20(thanks=20to=20Oktay=20Yolge=C3=A7en).=20-=20Added=20missin?= =?UTF-8?q?g=20rules=20for=20generating=20iso8859-13=20font=20to=20Makefil?= =?UTF-8?q?e.=20-=20'libsi'=20now=20converts=20the=20incoming=20strings=20?= =?UTF-8?q?into=20the=20system's=20character=20set=20=20=20according=20to?= =?UTF-8?q?=20the=20DVB=20standard.=20The=20system's=20character=20set=20i?= =?UTF-8?q?s=20determined=20from=20=20=20the=20LANG=20environment=20variab?= =?UTF-8?q?le.=20If=20no=20recognizable=20setting=20can=20be=20found,=20no?= =?UTF-8?q?=20=20=20conversion=20will=20take=20place.=20Note=20that=20curr?= =?UTF-8?q?ently=20only=20the=20strings=20received=20from=20the=20=20=20SI?= =?UTF-8?q?=20data=20stream=20are=20converted,=20there=20have=20not=20been?= =?UTF-8?q?=20any=20changes=20regarding=20displaying=20=20=20UTF-8=20chara?= =?UTF-8?q?cters=20on=20the=20OSD,=20yet=20-=20this=20will=20follow=20in?= =?UTF-8?q?=20one=20of=20the=20next=20steps.=20=20=20With=20this=20convers?= =?UTF-8?q?ion,=20it=20should=20now=20be=20safe=20to=20run=20VDR=20on=20a?= =?UTF-8?q?=20UTF-8=20file=20system,=20=20=20because=20all=20incoming=20ch?= =?UTF-8?q?aracters=20are=20converted=20to=20UTF-8.=20This=20will=20most?= =?UTF-8?q?=20likely=20=20=20result=20in=20wrong=20characters=20being=20di?= =?UTF-8?q?splayed=20on=20the=20OSD=20(because=20there=20UTF-8=20is=20=20?= =?UTF-8?q?=20not=20known,=20yet),=20but=20the=20file=20names=20should=20b?= =?UTF-8?q?e=20ok=20(haven't=20tested=20this=20myself,=20=20=20though,=20b?= =?UTF-8?q?ecause=20I=20don't=20do=20UTF-8=20-=20so=20please=20be=20very?= =?UTF-8?q?=20careful=20when=20testing!).=20=20=20There's=20one=20piece=20?= =?UTF-8?q?of=20bad=20news=20here:=20the=20German=20pay-tv=20broadcaster?= =?UTF-8?q?=20Premiere=20=20=20apparently=20encodes=20all=20EPG=20strings?= =?UTF-8?q?=20as=20ISO8859-1,=20but=20fails=20to=20correctly=20mark=20=20?= =?UTF-8?q?=20these=20strings=20as=20such.=20Therefore=20'libsi'=20(follow?= =?UTF-8?q?ing=20the=20DVB=20standard)=20considers=20=20=20the=20strings?= =?UTF-8?q?=20to=20be=20encoded=20in=20the=20default=20ISO6937=20and=20con?= =?UTF-8?q?verts=20them=20to=20whatever=20=20=20the=20system's=20character?= =?UTF-8?q?=20set=20is.=20This,=20of=20course,=20results=20in=20wrong=20um?= =?UTF-8?q?lauts.=20=20=20On=20its=20old=20transponder,=20the=20ProSieben/?= =?UTF-8?q?SAT.1=20channels=20also=20had=20their=20EPG=20data=20=20=20wron?= =?UTF-8?q?gly=20encoded,=20but=20apparently=20on=20the=20new=20transponde?= =?UTF-8?q?r=20they=20started=20broadcasting=20=20=20on=20this=20month,=20?= =?UTF-8?q?they=20got=20it=20right.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vdr.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'vdr.c') diff --git a/vdr.c b/vdr.c index 001a7cb..fa5d72b 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/vdr * - * $Id: vdr.c 1.285 2007/02/25 11:27:36 kls Exp $ + * $Id: vdr.c 1.287 2007/04/22 13:28:32 kls Exp $ */ #include @@ -455,15 +455,6 @@ int main(int argc, char *argv[]) return 0; } - // Check for UTF-8 and exit if present - asprintf() will fail if it encounters 8 bit ASCII codes - char *LangEnv; - if ((LangEnv = getenv("LANG")) != NULL && strcasestr(LangEnv, "utf") || - (LangEnv = getenv("LC_ALL")) != NULL && strcasestr(LangEnv, "utf") || - (LangEnv = getenv("LC_CTYPE")) != NULL && strcasestr(LangEnv, "utf")) { - fprintf(stderr, "vdr: please turn off UTF-8 before starting VDR\n"); - return 2; - } - // Log file: if (SysLogLevel > 0) @@ -500,6 +491,18 @@ int main(int argc, char *argv[]) dsyslog("running as daemon (tid=%d)", cThread::ThreadId()); cThread::SetMainThreadId(); + // Set the system character table: + + char *LangEnv = getenv("LANG"); + if (LangEnv) { + char *CodeSet = strchr(LangEnv, '.'); + if (CodeSet) { + CodeSet++; // skip the dot + bool known = SI::SetSystemCharacterTable(CodeSet); + isyslog("codeset is '%s' - %s", CodeSet, known ? "known" : "unknown"); + } + } + // Main program loop variables - need to be here to have them initialized before any EXIT(): cOsdObject *Menu = NULL; @@ -1162,7 +1165,7 @@ int main(int argc, char *argv[]) ShutdownHandler.countdown.Cancel(); } - if (!Interact && !cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection() && cRemote::LastActivity() > ACTIVITYTIMEOUT) { + if (!Interact && !cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection() && (time(NULL) - cRemote::LastActivity()) > ACTIVITYTIMEOUT) { // Handle housekeeping tasks // Shutdown: -- cgit v1.2.3