Re: [GENERAL] invalid byte sequence ?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: [GENERAL] invalid byte sequence ?
Дата
Msg-id 20060825155000.GK16535@svana.org
обсуждение исходный текст
Ответ на Re: [GENERAL] invalid byte sequence ?  (Peter Eisentraut <peter_e@gmx.net>)
Список 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@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GENERAL] invalid byte sequence ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Autovacuum on by default?