Re: Bug with PATHs having non-ASCII characters

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Chuck McDevitt <cmcdevitt(at)greenplum(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug with PATHs having non-ASCII characters
Date: 2010-01-07 18:00:41
Message-ID: 20100107180041.GF4315@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
> On Thu, Jan 7, 2010 at 02:37, Takahiro Itagaki
> <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:

> > 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.
>
> Shouldn't we develop this with "multi-platform" in mind from the
> start, instead of doing a Windows specific patch? It may be that we
> end up with two completely different codepaths, but more likely we can
> share some of it between them?

I'm not sure there's a lot you can do in platforms other than Windows.
On Windows the filenames are all Unicode and you know you can get them
using UTF16. On other platforms it could be anything, and it is
certainly not server_encoding; even different filesystems can use
different encodings.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Sabino Mullane 2010-01-07 18:04:50 Re: Streaming replication and postmaster signaling
Previous Message Robert Haas 2010-01-07 17:49:07 Re: Streaming replication and postmaster signaling