*** mbutils.c.orig Sun Nov 23 08:42:57 2008 --- mbutils.c Sun Nov 23 13:52:41 2008 *************** *** 825,830 **** --- 825,832 ---- void SetDatabaseEncoding(int encoding) { + const char *target_codeset = NULL; + if (!PG_VALID_BE_ENCODING(encoding)) elog(ERROR, "invalid database encoding: %d", encoding); *************** *** 846,852 **** */ #ifdef ENABLE_NLS if (encoding == PG_UTF8) ! if (bind_textdomain_codeset("postgres", "UTF-8") == NULL) elog(LOG, "bind_textdomain_codeset failed"); #endif } --- 848,860 ---- */ #ifdef ENABLE_NLS if (encoding == PG_UTF8) ! target_codeset = "UTF-8"; ! #ifdef WIN32 ! else if (encoding == PG_EUC_JP) ! target_codeset = "EUC_JP"; ! #endif /* WIN32 */ ! if (NULL != target_codeset) ! if (bind_textdomain_codeset("postgres", target_codeset) == NULL) elog(LOG, "bind_textdomain_codeset failed"); #endif }