Обсуждение: Re: RE : ? (question mark) characters

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

Re: RE : ? (question mark) characters

От
Kovács Péter
Дата:
> the driver what character set the backend is sending us? Can't
> it ask the backend dynamically?
>

This is what it actually does, isn't it? (Based on what I usually see in the
trace output on the backend.) I tested a unicode database with varchar(255)
fields and hungarian accented characters and it worked just fine. (With
PostgreSQL 7.2.1 I think.)

Peter

Re: RE : ? (question mark) characters

От
Rene Pijlman
Дата:
On Mon, 03 Sep 2001 09:49:27 -0700, you wrote:
>Yes this is exactly what the driver does.  It asks the server what
>character set is being used for the database.  Unfortunatly the server
>only knows about character sets if multibyte support is compiled in.  If
>the server is compiled without multibyte, then it always reports to the
>client that the character set is SQL_ASCII (where SQL_ASCII is 7bit
>ascii).  Thus if you don't have multibyte enabled on the server you
>can't support 8bit characters through the jdbc driver, unless you
>specifically tell the connection what character set to use (i.e.
>override the default obtained from the server).

Excellent explanation, thanks. This would be great info for the
FAQ. I've seen this issue appear three times or so in the
relatively short time I'm on this list.

Regards,
René Pijlman <rene@lab.applinet.nl>

Re: RE : ? (question mark) characters

От
Barry Lind
Дата:

Kovács Péter wrote:
>>the driver what character set the backend is sending us? Can't
>>it ask the backend dynamically?
>>
>>
>
> This is what it actually does, isn't it? (Based on what I usually see in the
> trace output on the backend.) I tested a unicode database with varchar(255)
> fields and hungarian accented characters and it worked just fine. (With
> PostgreSQL 7.2.1 I think.)
>

Yes this is exactly what the driver does.  It asks the server what
character set is being used for the database.  Unfortunatly the server
only knows about character sets if multibyte support is compiled in.  If
the server is compiled without multibyte, then it always reports to the
client that the character set is SQL_ASCII (where SQL_ASCII is 7bit
ascii).  Thus if you don't have multibyte enabled on the server you
can't support 8bit characters through the jdbc driver, unless you
specifically tell the connection what character set to use (i.e.
override the default obtained from the server).

thanks,
--Barry


Re: RE : ? (question mark) characters

От
Quentin DELANCE
Дата:
Barry Lind a écrit :
>
> Kovács Péter wrote:
> >>the driver what character set the backend is sending us? Can't
> >>it ask the backend dynamically?
> >>
> >>
> >
> > This is what it actually does, isn't it? (Based on what I usually see in the
> > trace output on the backend.) I tested a unicode database with varchar(255)
> > fields and hungarian accented characters and it worked just fine. (With
> > PostgreSQL 7.2.1 I think.)
> >
>
> Yes this is exactly what the driver does.  It asks the server what
> character set is being used for the database.  Unfortunatly the server
> only knows about character sets if multibyte support is compiled in.  If
> the server is compiled without multibyte, then it always reports to the
> client that the character set is SQL_ASCII (where SQL_ASCII is 7bit
> ascii).  Thus if you don't have multibyte enabled on the server you
> can't support 8bit characters through the jdbc driver, unless you
> specifically tell the connection what character set to use (i.e.
> override the default obtained from the server).
>
> thanks,
> --Barry

Thanks for the answer.
I am using a postgresql server rebuilt from a rawhide SRPM and I guess it is not
enabled by default (I can't check cause I don't have the SRPM anymore on my
hd...). It is a lot better to turn this option on by default though the current
solution (setting the charset properties manually fit me very well for my own
development).

    Quentin

--
Quentin DELANCE
e-mail : quentin.delance@insalien.org