Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-16 Thread Bruce Momjian
Robert Haas wrote: Sure, the logfile will be filled with mixed encoding strings, that could happen in logfile and syslog on non-win32 platforms. I think UTF8 is better than UTF16 for logfile encoding because there are some text editors that do not support wide characters. At any rate,

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-16 Thread Magnus Hagander
2009/10/13 Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp: Magnus Hagander mag...@hagander.net wrote: One other question - you note that WriteConsoleW() could fail if stderr is redirected. Are you saying that it will always fail when stderr is redirected, or only sometimes? If ony

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-15 Thread Robert Haas
On Mon, Oct 12, 2009 at 9:13 PM, Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp wrote: Magnus Hagander mag...@hagander.net wrote: One other question - you note that WriteConsoleW() could fail if stderr is redirected. Are you saying that it will always fail when stderr is redirected, or only

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-12 Thread Itagaki Takahiro
Magnus Hagander mag...@hagander.net wrote: One other question - you note that WriteConsoleW() could fail if stderr is redirected. Are you saying that it will always fail when stderr is redirected, or only sometimes? If ony sometimes, do you know under which conditions it happens? It will

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-10 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: 2009/10/7 Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp: Also I added the following error checks before calling pgwin32_toUTF16()    (errordata_stack_depth ERRORDATA_STACK_SIZE - 1) to avoid recursive errors, but I'm not sure it is really

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-09 Thread Magnus Hagander
2009/10/7 Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp: Magnus Hagander mag...@hagander.net wrote: Per your own comments earlier, and in the code, what will happen if pg_do_encoding_conversion() calls ereport()? Didn't you say we need a non-throwing version of it? We are hard to use

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-06 Thread Magnus Hagander
2009/9/15 Itagaki Takahiro itagaki.takah...@oss.ntt.co.jp: Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Can't we use MultiByteToWideChar() to convert directly to the required encoding, avoiding the double conversion? Here is an updated version of the patch. I use direct

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-10-06 Thread Itagaki Takahiro
Magnus Hagander mag...@hagander.net wrote: First of all, the change to port/open.c seems to be unrelated to the rest, and should be a separate patch, correct? I'm sure there's a usecase for it, but it's not actually included in the patches description, so I assume this was a mistake? It

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-09-20 Thread Josh Williams
On Tue, 2009-09-15 at 12:49 +0900, Itagaki Takahiro wrote: Here is an updated version of the patch. This is a review of the Eventlog encoding on Windows patch: http://archives.postgresql.org/message-id/20090915123243.9c59.52131...@oss.ntt.co.jp Purpose Format This patch is

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-09-14 Thread Heikki Linnakangas
Itagaki Takahiro wrote: We can choose different encodings from platform-dependent one for database, but postgres writes serverlogs in the database encoding. As the result, serverlogs are filled with broken characters. The problem could occur on all platforms, however, there is a solution

Re: [HACKERS] Encoding issues in console and eventlog on win32

2009-09-14 Thread Itagaki Takahiro
Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: Can't we use MultiByteToWideChar() to convert directly to the required encoding, avoiding the double conversion? Here is an updated version of the patch. I use direct conversion in pgwin32_toUTF16() if a corresponding codepage is

[HACKERS] Encoding issues in console and eventlog on win32

2009-08-16 Thread Itagaki Takahiro
We can choose different encodings from platform-dependent one for database, but postgres writes serverlogs in the database encoding. As the result, serverlogs are filled with broken characters. The problem could occur on all platforms, however, there is a solution for win32. Since Windows