Re: Encoding issues in console and eventlog on win32

Поиск
Список
Период
Сортировка
От Itagaki Takahiro
Тема Re: Encoding issues in console and eventlog on win32
Дата
Msg-id 20090915123243.9C59.52131E4D@oss.ntt.co.jp
обсуждение исходный текст
Ответ на Re: Encoding issues in console and eventlog on win32  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Encoding issues in console and eventlog on win32  (Josh Williams <joshwilliams@ij.net>)
Re: Encoding issues in console and eventlog on win32  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@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 available. If not available, I still use double conversion.

Now pgwin32_toUTF16() is exported from mbutil.c. I used the function
in following parts, although the main target of the patch is eventlog.

  * WriteConsoleW() - write unredirected stderr log.
  * ReportEventW()  - write evenlog.
  * CreateFileW()   - open non-ascii filename (ex. COPY TO/FROM 'mb-path').

This approach is only available for Windows because any other platform
don't support locale-independent and wide-character-based system calls.
Other platforms require a different approach, but even then we'd still
better have win32-specific routines because UTF16 is the native encoding
in Windows.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] BUG #5053: domain constraints still leak
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: [BUGS] BUG #5053: domain constraints still leak