Обсуждение: Encoding in UDF's

Поиск
Список
Период
Сортировка

Encoding in UDF's

От
"Andrij Korud"
Дата:
Hi
I have a postgres compiled with -mb=KOI8, store cyrillic data, get in the
client using different encoding (SET ENCODING=WIN1251, KOI8). The question
is: what should return stored procedure if I want to see it's output in
different encodings? Win1251, KOI8, UTF-8, something else?

Thanks in advance
Andriy Korud, Lviv, Ukraine.



Re: [HACKERS] Encoding in UDF's

От
Oleg Broytmann
Дата:
On 5 Nov 1999, Andrij Korud wrote:
> I have a postgres compiled with -mb=KOI8, store cyrillic data, get in the
> client using different encoding (SET ENCODING=WIN1251, KOI8). The question
> is: what should return stored procedure if I want to see it's output in
> different encodings? Win1251, KOI8, UTF-8, something else?
  Never tried it myself, but I'd expect windows-1251...
  SET PGCLIENTENCODING=WIN, of course.

Oleg.
----    Oleg Broytmann      Foundation for Effective Policies      phd@phd.russ.ru          Programmers don't die, they
justGOSUB without RETURN.
 



Re: [HACKERS] Encoding in UDF's

От
Tatsuo Ishii
Дата:
> I have a postgres compiled with -mb=KOI8, store cyrillic data, get in the
> client using different encoding (SET ENCODING=WIN1251, KOI8). The question                   ~~~~~~~~CLIENTENCODING
> is: what should return stored procedure if I want to see it's output in
> different encodings? Win1251, KOI8, UTF-8, something else?

I assume you mean "stored procedure" as user defined functions.

Since you have created your database with KOI8, any proccessing within
the backend is done in KOI8 no matter what client encodings are used.

So the answer is:
Your fuction would see the input data in KOI8 and should return data
in KOI8 too.
---
Tatsuo Ishii