Re: KOI8-R Problems!

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: KOI8-R Problems!
Дата
Msg-id 96D568DD7FAAAD428581F8B3BFD9B0F604DE3E@goldmine
обсуждение исходный текст
Ответ на KOI8-R Problems!  (Meder Bakirov <bakirov@transfer.kg>)
Список pgsql-jdbc
Hi Meder,

Is your installation compiled with multibyte enabled ?
I've had encoding problems using JDBC when I compiled without this option.
Finally I've used the following ./configure line:
./configure --with-java --enable-multibyte --enable-locale
Also in the newest version the database's default encoding is US-ASCII, and
you must set it explicitly to UNICODE when making initdb:
initdb -E UNICODE -D /data/directory
The encoding can be set per DB too:
createdb -E UNICODE your_data_base
Instead of UNICODE you might want to use KOI8-R, but I'm not sure if it
works with JDBC (I'm new to Postgres too :)
Also check out:
http://www.postgresql.org/idocs/index.php?multibyte.html

Cheers,
Cssaba.



-----Ursprungliche Nachricht-----
Von: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org]Im Auftrag von Meder Bakirov
Gesendet: Freitag, 18. Oktober 2002 07:49
An: pgsql-jdbc@postgresql.org
Betreff: [JDBC] KOI8-R Problems!


Hello list!

I have searched the net, but didn't find a solution, so finally I'm writing
here - to the list!

I have encountered a problem with a KOI8-R encoding in Postgresql! The
problem
is that, I cannot store Russian characters in database from JSP or servlets,

they are stored as ????? (i.e. substitutes each russian char to ?).

JSP and servlets work fine with KOI8-R, I can enter and display back russian

chars in KOI8-R from JSP and servlets. I use
request.setCharacterEncoding(response.getCharacterEncoding) in my servlets,
and contentType="text/html"; charset=KOI8-R in my JSP files, both of them
work fine with each other - russian chars are displayed normally.

Now, JDBC part!

When connecting to database, I set Connection properties of charSet=KOI8-R.
That is, props.setProperty("charSet","KOI8-R");

I use SQL_ASCII as a default encoding, but it is not a problem, I can store
russian chars from psql. I tried creating database with encoding 'KOI8-R',
but it did not solve a problem. Also, I tried setting properties of
encoding=KOI8-R, but it also did not make any changes!

The interesting part is that, when I insert russian chars from psql, they
are
normally displayed on my JSP page. And it makes me think, that a problem is
in Java+Postgresql chain somewhere.

But, anyway, I didn't give up with this issue and I hope I will solve this
problem in short time. But now, I need your help and hints to make a move
forward! :)

I can't finish my project, because of this issue :) Actually, I have - it
works, but with English chars only!

Anyway, thank you very much and sorry for a time, taken!

--
Rgrds, .coder!

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

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

Предыдущее
От: "Raymund"
Дата:
Сообщение: how to insert the letter "ñ"
Следующее
От: Eric Hallander
Дата:
Сообщение: UPDATE_RULE