tags 403867 + patch
thanks
Here is a patch (that was actually easier to have something working than
I thought. Real support for any charset that iconv() supports would be
another story, however).
Samuel
diff -ur catdvi-0.14-orig/catdvi.c catdvi-0.14/catdvi.c
--- catdvi-0.14-orig/catdvi.c 2007-12-18 23:02:13.000000000 +0000
+++ catdvi-0.14/catdvi.c 2007-12-18 23:07:21.000000000 +0000
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <langinfo.h>
#include "findtfm.h"
#include "readdvi.h"
#include "outenc.h"
@@ -70,9 +71,19 @@
{ 0, 0, 0, 0 }
};
static char const * shopt = "d:e:hl:p:NUs";
+ const char *charset;
+ enum outenc_num_t i;
setlocale(LC_ALL, "");
+ charset = nl_langinfo(CODESET);
+ for (i = 0; i < OE_TOOBIG; i++) {
+ if (!strcmp(charset, outenc_names[i])) {
+ outenc_num = i;
+ break;
+ }
+ }
+
msglevel = 10; /* Level of verbosity for pmesg */
#ifdef USE_MALLOC0