2c471de
diff -up vim71/src/xxd/xxd.c.xxd vim71/src/xxd/xxd.c
2c471de
--- vim71/src/xxd/xxd.c.xxd	2008-07-18 14:21:03.000000000 +0200
2c471de
+++ vim71/src/xxd/xxd.c	2008-07-18 14:23:48.000000000 +0200
2c471de
@@ -90,6 +90,7 @@
cvsdist 7a22376
 #if __MWERKS__ && !defined(BEBOX)
cvsdist 7a22376
 # include <unix.h>	/* for fdopen() on MAC */
cvsdist 7a22376
 #endif
cvsdist 7a22376
+#include <locale.h>
cvsdist 7a22376
 
2c471de
 #if defined(__BORLANDC__) && __BORLANDC__ <= 0x0410 && !defined(fileno)
2c471de
 /* Missing define and prototype grabbed from the BC 4.0 <stdio.h> */
2c471de
@@ -452,6 +453,11 @@ char *argv[];
cvsdist 7a22376
   long length = -1, n = 0, seekoff = 0;
cvsdist 7a22376
   char l[LLEN+1];
cvsdist 7a22376
   char *pname, *pp;
cvsdist 7a22376
+  char *lang=getenv("LANG");
cvsdist 7a22376
+  if(!lang) lang=getenv("LC_ALL");
cvsdist 7a22376
+  if(!lang) lang=getenv("LC_CTYPE");
cvsdist 7a22376
+  if(lang)
2c471de
+         setlocale(LC_ALL, lang);
cvsdist 7a22376
 
cvsdist 7a22376
 #ifdef AMIGA
cvsdist 7a22376
   /* This program doesn't work when started from the Workbench */
2c471de
@@ -756,7 +762,7 @@ char *argv[];
cvsdist 7a22376
 #else
cvsdist 7a22376
 	  (e > 31 && e < 127)
cvsdist 7a22376
 #endif
cvsdist 7a22376
-	  ? e : '.';
cvsdist 7a22376
+	  ? e : isalnum(e) ? e : '.';
cvsdist 7a22376
       if (e)
2c471de
 	nonzero++;
cvsdist 7a22376
       n++;