Re: [GENERAL] invalid byte sequence ?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] invalid byte sequence ?
Date: 2006-08-25 15:50:00
Message-ID: 20060825155000.GK16535@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Aug 25, 2006 at 05:38:20PM +0200, Peter Eisentraut wrote:
> > In fact, the only thing you need is PQsetClientEncodingFromLocale(),
> > anything else is just sugar. Why would the user care about what the OS
> > calls it? We have a "pg_enc" enum, so lets use it.
>
> initdb has different requirements. Let me know if you have a different way to
> refactor it that satisfies initdb.

Well, check_encodings_match(pg_enc,ctype) is simply a short way of
saying: if(find_matching_encoding(ctype) != pg_enc ) { error }.
And get_encoding_from_locale() is not used outside of those functions.

So the only thing initdb actually needs is an implementation of
find_matching_encoding(ctype), which returns a value of "enum pg_enc".
check_encodings_match() stays in initdb, and get_encoding_from_locale()
becomes internal to libpq.

How does that sound?

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message epost2 2006-08-25 16:09:09 getting on the system
Previous Message Peter Eisentraut 2006-08-25 15:38:20 Re: [GENERAL] invalid byte sequence ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-08-25 15:57:31 Re: Autovacuum on by default?
Previous Message Peter Eisentraut 2006-08-25 15:38:20 Re: [GENERAL] invalid byte sequence ?