diff -uNr jikes-1.15.orig/configure.in jikes-1.15/configure.in
--- jikes-1.15.orig/configure.in	Tue Nov  6 22:52:50 2001
+++ jikes-1.15/configure.in	Tue Nov  6 22:54:18 2001
@@ -79,7 +79,7 @@
 dnl	Check for standard c and c++ headers and libraries
 AC_HEADER_STDC()
 
-AC_CHECK_HEADERS(stdio.h assert.h limits.h ctype.h time.h float.h)
+AC_CHECK_HEADERS(stdio.h assert.h limits.h ctype.h time.h float.h locale.h langinfo.h)
 
 dnl	Check for some headers which are not present on all supported platforms
 AC_CHECK_HEADERS(windows.h direct.h dirent.h sys/cygwin.h langinfo.h locale.h)
@@ -112,6 +112,9 @@
 
 dnl	Check for cygwin path conversion functions
 AC_CHECK_FUNCS(cygwin_win32_to_posix_path_list)
+
+dnl	Check for locale and nl_langinfo
+AC_CHECK_FUNCS(setlocale nl_langinfo)
 
 dnl	Check for the strip utility, we use it to remove debugging info
 AC_CHECK_TOOL(STRIP, strip, :)
diff -uNr jikes-1.15.orig/src/jikes.cpp jikes-1.15/src/jikes.cpp
--- jikes-1.15.orig/src/jikes.cpp	Tue Nov  6 22:52:50 2001
+++ jikes-1.15/src/jikes.cpp	Tue Nov  6 22:53:14 2001
@@ -23,6 +23,10 @@
     int    return_code;    
     char **files;
 
+#ifdef HAVE_SETLOCALE
+    setlocale(LC_ALL,"");
+#endif
+
     files = compiler->parseOptions(argc, argv);
     
     if (files)
diff -uNr jikes-1.15.orig/src/jikesapi.cpp jikes-1.15/src/jikesapi.cpp
--- jikes-1.15.orig/src/jikesapi.cpp	Tue Nov  6 22:52:50 2001
+++ jikes-1.15/src/jikesapi.cpp	Tue Nov  6 22:53:14 2001
@@ -101,7 +101,6 @@
     classpath(NULL),
     sourcepath(NULL),
     directory(NULL),
-    encoding(NULL),
     nowrite(false),
     deprecation(false),
     O(false),
@@ -112,6 +111,24 @@
     old_classpath_search_order(false),
     zero_defect(false)
 {
+#ifdef HAVE_NL_LANGINFO
+    const char *codeset = nl_langinfo(CODESET);
+
+   // codeset is set to ANSI_X3.4-1968 when locale is 'C'.
+   // but then iconv seems that not work correctly.
+   // so if codeset is ANSI_X3.4-1968, set encoding NULL that treat
+   // codeset as ascii.
+   if(codeset != NULL && strcmp(codeset, "ANSI_X3.4-1968")){
+      encoding = new char[strlen(codeset) + 1];
+      strcpy(encoding, codeset); 
+   }
+    else 
+   {
+      encoding = NULL;
+   }
+#else
+    encoding = NULL;
+#endif
 }
 
 JikesAPI * JikesAPI::instance = NULL;
diff -uNr jikes-1.15.orig/src/platform.h jikes-1.15/src/platform.h
--- jikes-1.15.orig/src/platform.h	Tue Nov  6 22:52:50 2001
+++ jikes-1.15/src/platform.h	Tue Nov  6 22:53:14 2001
@@ -147,6 +147,14 @@
 # include <time.h>
 #endif
 
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
+#ifdef HAVE_LANGINFO_H
+# include <langinfo.h>
+#endif
+
 // C++ standard support
 
 #ifdef HAVE_STD
