Re: Bug with PATHs having non-ASCII characters

Поиск
Список
Период
Сортировка
Искать
От
Takahiro Itagaki
Тема
Re: Bug with PATHs having non-ASCII characters
Дата
Msg-id
20100107103740.97A5.52131E4D@oss.ntt.co.jp
Ответ на
Список
Дерево обсуждения
Type modifiers for DOMAIN Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
Re: Type modifiers for DOMAIN Tom Lane <tgl@sss.pgh.pa.us>
Re: Type modifiers for DOMAIN Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
Bug with PATHs having non-ASCII characters Chuck McDevitt <cmcdevitt@greenplum.com>
Re: Bug with PATHs having non-ASCII characters Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
Re: Bug with PATHs having non-ASCII characters Magnus Hagander <magnus@hagander.net>
Re: Bug with PATHs having non-ASCII characters Alvaro Herrera <alvherre@commandprompt.com>
Re: Bug with PATHs having non-ASCII characters Greg Stark <gsstark@mit.edu>
Re: Type modifiers for DOMAIN Jaime Casanova <jcasanov@systemguards.com.ec>
Re: Type modifiers for DOMAIN "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: Type modifiers for DOMAIN Josh Berkus <josh@agliodbs.com>

Chuck McDevitt  wrote:

> Just an FYI regarding this bug:
> http://archives.postgresql.org/pgsql-bugs/2009-12/msg00267.php
> 
> The wide-char version of any WIN32 API call will accept or return
> data in UTF-16 encoded Unicode, regardless of the local environment's
> single-byte (MBCS) encoding settings (codepage).

I have a Windows-specific patch for open(), attached for reference.
But we need to consider about other issues:

  - We need to consider about not only only open(), but also opendir(),
    stat() and symlink().

  - An entirely-different fix is needed for non-Windows platforms.
    Probably we will convert encodings from GetDatabaseEncoding() to
    GetPlatformEncoding() in MBCS, but this is not needed on Windows.
    We should consider avoiding random ifdef blocks for the switching.

  - Those conversions are not free. We might need to avoid conversions
    for paths under $PGDATA because we only use ascii names in the server.
    I used a test with IS_HIGHBIT_SET in the attached patch, but I'm not
    sure whether it is the best method.

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

В списке pgsql-hackers по дате отправления
От: Robert Haas
Дата:
От: Andrew Dunstan
Дата:
FAQ