Encoding from CopyManager.copyIn()

Поиск
Список
Период
Сортировка
От Markus Kickmaier
Тема Encoding from CopyManager.copyIn()
Дата
Msg-id 9709844.92821248280225595.JavaMail.root@donald.apus.co.at
обсуждение исходный текст
Ответы Re: Encoding from CopyManager.copyIn()
Re: Encoding from CopyManager.copyIn()
Re: Encoding from CopyManager.copyIn()
Список pgsql-jdbc
Hello,

I'm using the copyIn() function of the CopyManager. It works fine until I don't use an "umlaut" like ü. Then i get an
PSQLException:

org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0xfc

My code looks like follows:

ByteArrayOutputStream output = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(output);
writer.println("abcüäö");
writer.flush();
ByteArrayInputStream input = new ByteArrayInputStream(output.toByteArray());
long result = ((PGConnection) con_).getCopyAPI().copyIn(statement, input);

After searching at google i found out that this is an encoding problem. The database doesn't know what charset I'm
using.

Any suggestion how i can specify the encoding i want to use?

BR, Markus

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: IQ in Postgre
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Encoding from CopyManager.copyIn()