Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1e22e60

Browse files
committed
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
1 parent 6cd9a58 commit 1e22e60

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/backend/port/dynloader/win32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.8 2006/06/07 22:24:43 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.9 2006/12/04 22:23:40 momjian Exp $ */
22

33
#include "postgres.h"
44

@@ -18,7 +18,7 @@ set_dl_error(void)
1818
FORMAT_MESSAGE_FROM_SYSTEM,
1919
NULL,
2020
err,
21-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
21+
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
2222
last_dyn_error,
2323
sizeof(last_dyn_error) - 1,
2424
NULL) == 0)

src/backend/port/win32/socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.14 2006/10/13 13:59:47 teodor Exp $
9+
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.15 2006/12/04 22:23:40 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -582,7 +582,7 @@ pgwin32_socket_strerror(int err)
582582
if (FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE,
583583
handleDLL,
584584
err,
585-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
585+
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
586586
wserrbuf,
587587
sizeof(wserrbuf) - 1,
588588
NULL) == 0)

src/interfaces/libpq/win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ winsock_strerror(int err, char *strerrbuf, size_t buflen)
309309
success = 0 != FormatMessage(
310310
flags,
311311
dlls[i].handle, err,
312-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
312+
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
313313
strerrbuf, buflen - 64,
314314
0
315315
);

src/port/dirmod.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.44 2006/11/08 20:12:05 tgl Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.45 2006/12/04 22:23:40 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -254,7 +254,7 @@ pgsymlink(const char *oldpath, const char *newpath)
254254
errno = 0;
255255
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
256256
NULL, GetLastError(),
257-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
257+
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
258258
(LPSTR) & msg, 0, NULL);
259259
#ifndef FRONTEND
260260
ereport(ERROR,

0 commit comments

Comments
 (0)