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 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
eventlog-20090915.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers