summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2006-12-04 22:24:04 +0000
committerBruce Momjian2006-12-04 22:24:04 +0000
commit4e5581181995e441165fa90c25ef15e00fcd30dc (patch)
tree67b991dd417a8130783ba135cbbcbaafe69bd588
parent8a20e430518ee95a15614679335693994bc98b61 (diff)
Patch of Win32 Encoding problem for server messages using
FormatMessage() (This should have been in 8.2.0, patched to 8.2.X and HEAD): I think this problem to be complex.... http://archives.postgresql.org/pgsql-hackers/2006-11/msg00042.php FormatMessage of windows cannot consider the encoding of the database. However, I should try the solution now. It is necessary to clear the problem. Multi character-code exists together in message and log. It doesn't consider the data base encoding that the user intended.... The user in multi-byte country can try this. http://inet.winpg.jp/~saito/pg_bug/MessageCheck.c That is, it is likely to become it in this manner.(Japanese) http://inet.winpg.jp/~saito/pg_bug/FormatMessage998.png Hiroshi Saito
-rw-r--r--src/backend/port/dynloader/win32.c2
-rw-r--r--src/backend/port/win32/socket.c2
-rw-r--r--src/interfaces/libpq/win32.c2
-rw-r--r--src/port/dirmod.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/port/dynloader/win32.c b/src/backend/port/dynloader/win32.c
index f47f8adb8a..ab5f5af750 100644
--- a/src/backend/port/dynloader/win32.c
+++ b/src/backend/port/dynloader/win32.c
@@ -18,7 +18,7 @@ set_dl_error(void)
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
last_dyn_error,
sizeof(last_dyn_error) - 1,
NULL) == 0)
diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c
index e55ab0ca46..265f0c44b0 100644
--- a/src/backend/port/win32/socket.c
+++ b/src/backend/port/win32/socket.c
@@ -582,7 +582,7 @@ pgwin32_socket_strerror(int err)
if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE,
handleDLL,
err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
wserrbuf,
sizeof(wserrbuf) - 1,
NULL) == 0)
diff --git a/src/interfaces/libpq/win32.c b/src/interfaces/libpq/win32.c
index a4ec2ebb70..00f0e0073d 100644
--- a/src/interfaces/libpq/win32.c
+++ b/src/interfaces/libpq/win32.c
@@ -309,7 +309,7 @@ winsock_strerror(int err, char *strerrbuf, size_t buflen)
success = 0 != FormatMessage(
flags,
dlls[i].handle, err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
strerrbuf, buflen - 64,
0
);
diff --git a/src/port/dirmod.c b/src/port/dirmod.c
index 4e7cf83e19..ab54dfc914 100644
--- a/src/port/dirmod.c
+++ b/src/port/dirmod.c
@@ -254,7 +254,7 @@ pgsymlink(const char *oldpath, const char *newpath)
errno = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
(LPSTR) & msg, 0, NULL);
#ifndef FRONTEND
ereport(ERROR,