summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/vdr.c b/vdr.c
index f7ff1b5..e28c728 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,11 +22,12 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.291 2007/06/09 12:33:53 kls Exp $
+ * $Id: vdr.c 1.293 2007/06/17 11:23:08 kls Exp $
*/
#include <getopt.h>
#include <grp.h>
+#include <langinfo.h>
#include <locale.h>
#include <pwd.h>
#include <signal.h>
@@ -493,18 +494,22 @@ int main(int argc, char *argv[])
// Set the system character table:
- char *LangEnv = setlocale(LC_CTYPE, "");
- if (!LangEnv)
- LangEnv = getenv("LANG"); // last resort in case locale stuff isn't installed
- 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");
- cCharSetConv::SetSystemCharacterTable(CodeSet);
+ char *CodeSet = NULL;
+ if (setlocale(LC_CTYPE, ""))
+ CodeSet = nl_langinfo(CODESET);
+ else {
+ char *LangEnv = getenv("LANG"); // last resort in case locale stuff isn't installed
+ if (LangEnv) {
+ CodeSet = strchr(LangEnv, '.');
+ if (CodeSet)
+ CodeSet++; // skip the dot
}
}
+ if (CodeSet) {
+ bool known = SI::SetSystemCharacterTable(CodeSet);
+ isyslog("codeset is '%s' - %s", CodeSet, known ? "known" : "unknown");
+ cCharSetConv::SetSystemCharacterTable(CodeSet);
+ }
// Main program loop variables - need to be here to have them initialized before any EXIT():
@@ -545,6 +550,12 @@ int main(int argc, char *argv[])
))
EXIT(2);
+ if (!*cFont::GetFontFileName(Setup.FontOsd)) {
+ const char *msg = "no fonts available - OSD will not show any text!";
+ fprintf(stderr, "vdr: %s\n", msg);
+ esyslog("ERROR: %s", msg);
+ }
+
// Recordings:
Recordings.Update();