diff -rup2 ../ruby-1.8.1-base/defines.h ./defines.h
--- ../ruby-1.8.1-base/defines.h	Mon Dec 22 18:25:48 2003
+++ ./defines.h	Thu Dec 25 09:32:16 2003
@@ -189,3 +189,11 @@ flush_register_windows(void)
 #endif
 
+#if defined(__EMX__)
+#define RUBY_MBCHAR_MAXSIZE INT_MAX
+#else
+  /* when mblen() works well for MB characters without setlocale(), 
+     namely, it also works for them even in C locale. why it works ? */
+#define RUBY_MBCHAR_MAXSIZE MB_CUR_MAX
+#endif
+
 #endif
diff -rup2 ../ruby-1.8.1-base/file.c ./file.c
--- ../ruby-1.8.1-base/file.c	Thu Dec 25 00:19:08 2003
+++ ./file.c	Thu Dec 25 09:32:46 2003
@@ -2076,5 +2081,5 @@ rb_file_s_umask(argc, argv)
 #ifndef CharNext		/* defined as CharNext[AW] on Windows. */
 # if defined(DJGPP)
-#   define CharNext(p) ((p) + mblen(p, MB_CUR_MAX))
+#   define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
 # else
 #   define CharNext(p) ((p) + 1)
diff -rup2 ../ruby-1.8.1-base/ruby.c ./ruby.c
--- ../ruby-1.8.1-base/ruby.c	Thu Dec 18 17:08:50 2003
+++ ./ruby.c	Thu Dec 25 09:33:08 2003
@@ -227,5 +227,5 @@ translate_char(p, from, to)
 	p = CharNext(p);
 #else
-	p += mblen(p, MB_CUR_MAX);
+	p += mblen(p, RUBY_MBCHAR_MAXSIZE);
 #endif
     }
diff -rup2 ../ruby-1.8.1-base/util.c ./util.c
--- ../ruby-1.8.1-base/util.c	Sat Nov 22 12:59:18 2003
+++ ./util.c	Thu Dec 25 09:32:56 2003
@@ -348,5 +348,5 @@ __crt0_glob_function(char *path)
     buf[len] = '\0';
 
-    for (p = buf; *p; p += mblen(p, MB_CUR_MAX))
+    for (p = buf; *p; p += mblen(p, RUBY_MBCHAR_MAXSIZE))
 	if (*p == '\\')
 	    *p = '/';
