Index: include/mdbtools.h
===================================================================
--- include/mdbtools.h	(revision 483261)
+++ include/mdbtools.h	(working copy)
@@ -244,6 +244,7 @@
 	MdbStatistics *stats;
 #endif
 #ifdef HAVE_ICONV
+	char*	jet3_iconv_code;
 	iconv_t	iconv_in;
 	iconv_t	iconv_out;
 #endif
@@ -420,6 +421,7 @@
 extern long   mdb_pg_get_int32(MdbHandle *mdb, int offset);
 extern float  mdb_pg_get_single(MdbHandle *mdb, int offset);
 extern double mdb_pg_get_double(MdbHandle *mdb, int offset);
+extern void mdb_set_encoding(MdbHandle *mdb, const char *encoding_name);
 extern MdbHandle *mdb_open(const char *filename, MdbFileFlags flags);
 extern void mdb_close(MdbHandle *mdb);
 extern MdbHandle *mdb_clone_handle(MdbHandle *mdb);
Index: libmdb/iconv.c
===================================================================
--- libmdb/iconv.c	(revision 483261)
+++ libmdb/iconv.c	(working copy)
@@ -24,6 +24,10 @@
 #include "dmalloc.h"
 #endif
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 /*
  * This function is used in reading text data from an MDB table.
  */
@@ -192,18 +196,28 @@
                 mdb->iconv_out = iconv_open("UCS-2LE", iconv_code);
                 mdb->iconv_in = iconv_open(iconv_code, "UCS-2LE");
         } else {
-                /* According to Microsoft Knowledge Base pages 289525 and */
+		/* According to Microsoft Knowledge Base pages 289525 and */
 		/* 202427, code page info is not contained in the database */
-		const char *jet3_iconv_code;
 
 		/* check environment variable */
-		if (!(jet3_iconv_code=getenv("MDB_JET3_CHARSET"))) {
-			jet3_iconv_code="CP1252";
+		const char *jet3_iconv_code_from_env = getenv("MDB_JET3_CHARSET");
+		if (jet3_iconv_code_from_env)
+			mdb_set_encoding(mdb, jet3_iconv_code_from_env);
+		else if (!mdb->jet3_iconv_code) {
+#ifdef _WIN32
+			// get the default from OS
+			char default_encoding[] = "CP       ";
+			if (GetLocaleInfoA( MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), SORT_DEFAULT), 
+			 LOCALE_IDEFAULTANSICODEPAGE, default_encoding+2, sizeof(default_encoding)-2-1 ))
+				mdb->jet3_iconv_code = g_strdup(default_encoding);
+			else
+#endif
+				mdb->jet3_iconv_code = g_strdup("CP1252");
 		}
 
-                mdb->iconv_out = iconv_open(jet3_iconv_code, iconv_code);
-                mdb->iconv_in = iconv_open(iconv_code, jet3_iconv_code);
-        }
+		mdb->iconv_out = iconv_open(mdb->jet3_iconv_code, iconv_code);
+		mdb->iconv_in = iconv_open(iconv_code, mdb->jet3_iconv_code);
+	}
 #endif
 }
 void mdb_iconv_close(MdbHandle *mdb)
Index: libmdb/file.c
===================================================================
--- libmdb/file.c	(revision 483261)
+++ libmdb/file.c	(working copy)
@@ -94,7 +94,33 @@
 	g_strfreev(dir);
 	return NULL;
 }
+
 /**
+ * mdb_set_encoding:
+ * @mdb: Handle to MDB database file
+ * @encoding_name: encoding name for MDB (database) file in JET3 version.
+ *                 A copy of the string will be created.
+ *
+ * Sets encoding name for MDB (database) file in JET3 version.
+ * JET3 databases have no usincode support but only ANSI code page (e.g. CP1252)
+ * (not ISO), so you need to decide what code page strings in the MDB file are encoded in.
+ *
+ * Use this function after mdb_open()) but BEFORE any operation which reads text strings 
+ * from the MDB file.
+ * "MDB_JET3_CHARSET" environment variable has priority over this setting.
+ *
+ **/
+void mdb_set_encoding(MdbHandle *mdb, const char *encoding_name)
+{
+#ifdef HAVE_ICONV
+	mdb_iconv_close(mdb);
+	g_free(mdb->jet3_iconv_code);
+	mdb->jet3_iconv_code = g_strdup(encoding_name);
+	mdb_iconv_init(mdb);
+#endif
+}
+
+/**
  * mdb_open:
  * @filename: path to MDB (database) file
  * @flags: MDB_NOFLAGS for read-only, MDB_WRITABLE for read/write
@@ -115,6 +141,7 @@
 	mdb_set_default_backend(mdb, "access");
 #endif
 #ifdef HAVE_ICONV
+	mdb->jet3_iconv_code = 0;
 	mdb->iconv_in = (iconv_t)-1;
 	mdb->iconv_out = (iconv_t)-1;
 #endif
@@ -201,6 +228,9 @@
 
 	mdb_iconv_close(mdb);
 
+#ifdef HAVE_ICONV
+	g_free(mdb->jet3_iconv_code);
+#endif
 	g_free(mdb);
 }
 /**
@@ -229,12 +259,15 @@
 		g_ptr_array_add(newmdb->catalog, data);
 	}
 #if !MDB_NO_BACKENDS
-	mdb->backend_name = NULL;
+	newmdb->backend_name = NULL;
 #endif
 	if (mdb->f) {
 		mdb->f->refs++;
 	}
-	mdb_iconv_init(mdb);
+#ifdef HAVE_ICONV
+	newmdb->jet3_iconv_code = g_strdup(mdb->jet3_iconv_code);
+#endif
+	mdb_iconv_init(newmdb);
 
 	return newmdb;
 }
