	In TeX Live we use binary mode for all output files.

diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
--- detex-2.8.orig/detex.l	2012-08-24 10:37:03.000000000 +0200
+++ detex-2.8/detex.l	2012-08-24 10:51:12.000000000 +0200
@@ -83,6 +83,11 @@
 #include <stdlib.h>
 #endif
 
+#ifdef WIN32
+#include <fcntl.h>
+#include <io.h>
+#endif
+
 #endif /* KPATHSEA */
 
 #undef IGNORE
@@ -494,6 +499,10 @@
 	}
 	SetEnvIgnore(sbEnvList);
 
+#ifdef WIN32
+	_setmode(fileno(stdout), _O_BINARY);
+#endif
+
 	/* process input files */
 	for (; iArgs < cArgs; iArgs++) {
 	    fSawFile++;
