Index: dumpasn1-20101112/dumpasn1.c
===================================================================
--- dumpasn1-20101112.orig/dumpasn1.c	2012-05-14 15:55:40.000000000 +0200
+++ dumpasn1-20101112/dumpasn1.c	2012-05-14 16:00:23.000000000 +0200
@@ -50,6 +50,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <locale.h>
 #ifdef OS390
   #include <unistd.h>
 #endif /* OS390 */
@@ -925,7 +926,6 @@
 			for( i = 0; !isEnvTerminator( pathBuffer[ pathPos + i ] ); i++ );
 			memcpy( envName, pathBuffer + pathPos, i );
 			envName[ i ] = '\0';
-
 			/* Get the env.string and copy it over */
 			if( ( envString = getenv( envName ) ) != NULL )
 				{
@@ -1579,7 +1579,7 @@
 				warnBMP = TRUE;
 			else
 				{
-				const wchar_t wCh = ( ch << 8 ) | getc( inFile );
+				const wchar_t wCh[2] ={ ( ch << 8 ) | getc( inFile ),0};
 				char outBuf[ 8 ];
 #ifdef __OS390__
 				char *p;
@@ -1593,12 +1593,12 @@
 				   the data as non-Unicode.  There's one exception to this
 				   case, which is for a wrong-endianness Unicode string, for
 				   which the first character looks like a single ASCII char */
-				outLen = wcstombs( outBuf, &wCh, 1 );
+				outLen = wcstombs( outBuf, wCh, 8 );
 				if( outLen < 1 )
 					{
 					/* Can't be displayed as Unicode, fall back to
 					   displaying it as normal text */
-					ungetc( wCh & 0xFF, inFile );
+					ungetc( wCh[0] & 0xFF, inFile );
 					}
 				else
 					{
@@ -1620,13 +1620,7 @@
 					   modes around the display of the widechar */
 					if( level < maxNestLevel )
 						{
-						if( fwide( output, 1 ) > 0 )
-							{
-							fputwc( wCh, output );
-							fwide( output, -1 );
-							}
-						else
-							fputc( wCh, output );
+            fprintf( output, "%s", outBuf );
 						}
 #else
   #ifdef __OS390__
@@ -2688,7 +2682,14 @@
 #endif /* __OS390__ */
 	long offset = 0;
 	int moreArgs = TRUE, doCheckOnly = FALSE;
-
+	
+	setlocale(LC_ALL,
+#ifdef __WIN32__
+			".OCP"
+#else			
+			""
+#endif			
+);
 #ifdef __OS390__
 	memset( pathPtr, '\0', sizeof( pathPtr ) );
 	getcwd( pathPtr, sizeof( pathPtr ) );
