Re: JDBC and Accents
От | Marko Kreen |
---|---|
Тема | Re: JDBC and Accents |
Дата | |
Msg-id | 20010427152459.A30250@l-t.ee обсуждение исходный текст |
Ответ на | Re: JDBC and Accents (Tony Grant <tony@animaproductions.com>) |
Список | pgsql-general |
On Fri, Apr 27, 2001 at 02:37:48PM +0200, Tony Grant wrote: > On 27 Apr 2001 14:26:14 +0200, Marko Kreen wrote: > > > > > What is your database encoding? > > > > You can insert whatever stuff you want into db and > > psql displays it fine - it does not care what it is. > > > > But JDBC 7.1 does use database encoding for understanding > > stuff it gets and translating it to Java strings. So if your > > db encoding is SQL_ASCII but data is LATIN1 you are screwed. > > Same with data in LATIN1 and db in UNICODE. etc... > > How do I set it? initdb --ecnoding ENC sets the template* encoding, this gets used when you dont specify the encoding in db creation time. CREATE DATABASE xx WITH ECCODING='ENC'; createdb xx --encoding ENC same thing, sets the new database encoding. and there is commands SET CLIENT_ENCODING='ENC'; SET SERVER_ENCODING='ENC'; which set the encoding for one session. SERVER_ENCODING is r/o though. CLIENT_ENCODING Im not so sure, probably commands the server to do on-the-fly encoding conversion for client. I expect this needs correct database encoding... > Searching docs for "database encoding" gives: > > Sorry, but search returned no results. It _is_ documented somewhere but I cant do much surfing at the moment coz Iam sitting behind a 80x25 Video Terminal... > > Is this the locale value that can be passed at start up? I will document > this in my Ultradev - Posgresql HOWTO because it is JDBC related. Look in docs help for above commands. -- marko
В списке pgsql-general по дате отправления: