Обсуждение: Problem with LATIN2 encoding

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

Problem with LATIN2 encoding

От
Ryszard Lach
Дата:
Hi!

I thing I've read almos all documents possible to find using google
about character encoding and Java applications. Please, help me to
understand why my strings are not inserted to database correctly.

I'm using database in LATIN2 character set, postgresql7.2,
postgresql-7.2.jar, postgresql compiled with multibyte enabled (the
default configuration in Debian), application is a servlet running under
Tomcat4.0.3, jdk1.3.1 from Sun.

My database connection url contains 'charSet=LATIN2', but I'm not sure
if it should be encoding of the database. If yes, then client (JVM
running the servlet) working in UTF-8 should perform 'set
client_encoding to UNICODE' before running any inserts to inform
database engine about conversions, which it should perform, right ?

I suppose not, because it doesn't work, the field in the database is
being filled with question marks instead of every non-ASCII character.

Can anybody help me ?

regards,

Richard.

--
"First they ignore you. Then they laugh at you. Then they
fight you. Then you win." - Mohandas Gandhi.

Re: Problem with LATIN2 encoding

От
Barry Lind
Дата:
What is the character set of your database?  Issue the following query
to determine that: select getdatabaseencoding();

If getdatabaseencoding() returns the correct character set, then you
don't need to specify the charSet=LATIN2 on the URL as the driver
automatically uses the character set of the database it is connecting to.

If you are still having problems could you submit a test case that
demonstrates the problem?

thanks,
--Barry


Ryszard Lach wrote:

>Hi!
>
>I thing I've read almos all documents possible to find using google
>about character encoding and Java applications. Please, help me to
>understand why my strings are not inserted to database correctly.
>
>I'm using database in LATIN2 character set, postgresql7.2,
>postgresql-7.2.jar, postgresql compiled with multibyte enabled (the
>default configuration in Debian), application is a servlet running under
>Tomcat4.0.3, jdk1.3.1 from Sun.
>
>My database connection url contains 'charSet=LATIN2', but I'm not sure
>if it should be encoding of the database. If yes, then client (JVM
>running the servlet) working in UTF-8 should perform 'set
>client_encoding to UNICODE' before running any inserts to inform
>database engine about conversions, which it should perform, right ?
>
>I suppose not, because it doesn't work, the field in the database is
>being filled with question marks instead of every non-ASCII character.
>
>Can anybody help me ?
>
>regards,
>
>Richard.
>
>
>



[BUG] Driver compile error

От
"Aslak Hellesoy"
Дата:
org.postgresql.PostgresqlDataSource doesn't compile with javac (JDK 1.3).
The getConnection(String, String) has a     catch block that catches a
java.sql.SQLException, but that exception is never thrown in the try block.

Cheers,
Aslak