Index: net-snmp-5.5/snmplib/parse.c
===================================================================
--- net-snmp-5.5.orig/snmplib/parse.c
+++ net-snmp-5.5/snmplib/parse.c
@@ -101,6 +101,7 @@ SOFTWARE.
 #endif
 
 #include <errno.h>
+#include <locale.h>
 
 #include <net-snmp/types.h>
 #include <net-snmp/output_api.h>
@@ -4785,6 +4786,8 @@ add_mibdir(const char *dirname)
     char newline;
     struct stat     dir_stat, idx_stat;
     char            tmpstr1[300];
+    char *locale_data = setlocale(LC_CTYPE, "");
+    setlocale(LC_CTYPE, "C");
 #endif
 
     DEBUGMSGTL(("parse-mibs", "Scanning directory %s\n", dirname));
@@ -4817,6 +4820,7 @@ add_mibdir(const char *dirname)
                     count++;
                 }
                 fclose(ip);
+                setlocale(LC_CTYPE, locale_data);
                 return count;
             } else
                 DEBUGMSGTL(("parse-mibs", "Can't read index\n"));
@@ -4858,11 +4862,13 @@ add_mibdir(const char *dirname)
         closedir(dir);
         if (ip)
             fclose(ip);
+        setlocale(LC_CTYPE, locale_data);
         return (count);
     }
     else
         DEBUGMSGTL(("parse-mibs","cannot open MIB directory %s\n", dirname));
 
+    setlocale(LC_CTYPE, locale_data);
     return (-1);
 }
 
