summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c25
1 files changed, 14 insertions, 11 deletions
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 <getopt.h>
@@ -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: