Re: patch: utf8_to_unicode (trivial)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: utf8_to_unicode (trivial)
Date: 2010-08-13 16:00:32
Message-ID: AANLkTinPVJidQ2_d4zK+EXQbqEGFjCG_nJosUfuTS6Q2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 13, 2010 at 3:12 AM, Joseph Adams
<joeyadams3(dot)14159(at)gmail(dot)com> wrote:
> I've attached another patch that moves utf8_to_unicode to src/port per
> Robert Haas's suggestion.
>
> This patch itself is not quite as elegant as the first one because it
> puts platform-independent code that "belongs" in wchar.c into src/port
> .  It also uses unsigned int instead of pg_wchar because the typedef
> of pg_wchar isn't available to the frontend, if I'm not mistaken.

Well, right now, in addition to having two copies of utf2ucs(), we
have two declarations of pg_wchar, one in src/bin/psql/mbprint.c and
the other in src/include/mb/pg_wchar.h; so both existing copies of the
function are able to use that typedef. It seems like we might want to
move the typedef to the same place as the declaration of the renamed
utf2ucs(), but I'm not quite sure where that should be. The only
header in src/port is pthread-win32.h, and we're sure not going to put
it there.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-13 16:01:24 Re: RecordTransactionCommit() and SharedInvalidationMessages
Previous Message Robert Haas 2010-08-13 15:11:19 Re: [HACKERS] postgres 9.0 crash when bringing up hot standby