summaryrefslogtreecommitdiff
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
parente199411a288d2dc18c7a42ff56064695fcb4b3c6 (diff)
downloadvdr-0e951afc2b8966039177f60b413bc1df245fcbaa.tar.gz
vdr-0e951afc2b8966039177f60b413bc1df245fcbaa.tar.bz2
Checking for UTF-8 at program start
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY5
-rw-r--r--INSTALL12
-rw-r--r--vdr.c12
4 files changed, 25 insertions, 5 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index d6f34f1d..ea9354a2 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -730,6 +730,7 @@ Ludwig Nussel <ludwig.nussel@web.de>
for reporting a problem with the LIRC remote control trying to learn keys even if it
couldn't connect to the LIRC daemon
for making the plugin library directory configurable via Make.config
+ for reporting a problem on systems that have UTF-8 enabled
Thomas Koch <tom@harhar.net>
for his support in keeping the Premiere World channels up to date in 'channels.conf'
diff --git a/HISTORY b/HISTORY
index 03698ddb..c2a7c343 100644
--- a/HISTORY
+++ b/HISTORY
@@ -2893,7 +2893,7 @@ Video Disk Recorder Revision History
strings in order to avoid buffer overflows (thanks to Philip Lawatsch for
debugging a buffer overflow in eit.c).
-2004-06-10: Version 1.3.11
+2004-06-12: Version 1.3.11
- In order to avoid problems on NPTL systems, VDR now checks for the presence
of NPTL at program start, and if it is, exists and tells the user to do
@@ -2901,3 +2901,6 @@ Video Disk Recorder Revision History
- Revoked the "Fixed missing audio after replaying a DVD" change because it
introduced a sound disturbance when switching between channels on the same
transponder.
+- In order to avoid problems on UTF-8 systems, VDR now checks for the presence
+ of UTF-8 at program start, and if it is, exists and tells the user to turn off
+ UTF-8 before starting VDR.
diff --git a/INSTALL b/INSTALL
index 012dd946..4eefa98b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,8 +4,8 @@ Installation of the Video Disk Recorder
Version 1.3
-----------
-IMPORTANT NOTE:
----------------
+IMPORTANT NOTES:
+----------------
VDR currently doesn't work with NPTL ("Native Posix Thread Library").
Either don't use NPTL, or set the environment variable
@@ -14,6 +14,14 @@ Either don't use NPTL, or set the environment variable
before running VDR.
+Also, please make sure your environment is NOT set to use UTF-8 or
+any other multibyte character representation. Check the value of your
+$LANG or $LC_CTYPE environment variable, and if it contains something
+like "de_DE.UTF-8", make sure you set it to something like "de_DE.iso8859-1"
+or whatever single byte character mode you want. If you run VDR with
+UTF-8 enabled, it may crash in case it encounters EPG or channel data
+that contains non-7-bit ASCII characters.
+
Compiling and running the program:
----------------------------------
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;