summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-06-12 10:17:20 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2004-06-12 10:17:20 +0200
commit0e951afc2b8966039177f60b413bc1df245fcbaa (patch)
tree51bb5ad6291b54236c3562902dbe3dc4c7bad51a /vdr.c
parente199411a288d2dc18c7a42ff56064695fcb4b3c6 (diff)
downloadvdr-0e951afc2b8966039177f60b413bc1df245fcbaa.tar.gz
vdr-0e951afc2b8966039177f60b413bc1df245fcbaa.tar.bz2
Checking for UTF-8 at program start
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/vdr.c b/vdr.c
index de042d4e..23f24957 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.182 2004/06/10 13:22:08 kls Exp $
+ * $Id: vdr.c 1.183 2004/06/12 10:07:17 kls Exp $
*/
#include <getopt.h>
@@ -89,12 +89,20 @@ int main(int argc, char *argv[])
char LibPthreadVersion[128];
if (confstr(_CS_GNU_LIBPTHREAD_VERSION, LibPthreadVersion, sizeof(LibPthreadVersion) > 0)) {
if (strstr(LibPthreadVersion, "NPTL")) {
- fprintf(stderr, "vdr: please turn off NPTL by setting 'export LD_ASSUME_KERNEL=2.4.1' before starting VDR");
+ fprintf(stderr, "vdr: please turn off NPTL by setting 'export LD_ASSUME_KERNEL=2.4.1' before starting VDR\n");
return 2;
}
}
#endif
+ // 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_TYPE")) != NULL && strcasestr(LangEnv, "utf")) {
+ fprintf(stderr, "vdr: please turn off UTF-8 before starting VDR\n");
+ return 2;
+ }
+
// Save terminal settings:
struct termios savedTm;