Subject Re: [Firebird-Java] Re: Trying to run TrackStudio :-)
Author Roman Rokytskyy
Sorry for not replying inline - it is impossible on the phone. But
let's continue...

The character set for connection is specifies in DPB, the property is
called lc_ctype. If the property is not specified, then server assumes
NONE. This logic is coded in Firebird, not in driver.

The only right solution would be to ditch the NONE defaulting on the
server, then we would default to UTF-8, and everybody would be happy.
This sounds as a reasonable approach, since I know no other database
server, where the default charset is "raw data", admin has to specify
that one during installation.


Gesendet mit AquaMail für Android

Am 29. Juni 2012 10:19:51 schrieb "the_a_rioch" <ariochthe@...>:
> > The issue with Java is, that every byte sequence has to be converted to
> > a Unicode characters. That is Java. Period. Or access them as byte
> > array. Another period. :)
> In Delphi you has also option to have char array/pointer.
> And after Delphi switched to Unicode - it is a messs... :-)
> > With your Delphi background you can think of having only wide strings
> > and doing oem-to-ansi conversion each time you get some raw data from
> > disk or network.
> No-no-no, OEM2ANSI is different beast - it is transcoding SBCSes,
> AnsiString in Delphi terms. But i understand what u meant. Since
> Windows is runing in two different russian encodings at same time - how
> can anyone from Russia forget those issues :-D
> > In order to convert a byte steam into a string you
> > have to make assumptions re in which encoding data is coming in.
> And those assumptions should match at both sides of pipe.
> I'd say they should be enforced to match.
> > The
> > encoding parameter in the connection string tells the server, in which
> > encoding we want to receive data,
> Conenction string ? Is it the thing we pass to FBClient.DLL, so it is
> exposed in data access components ? Or, respectively, connection string
> is JDBC URL.
> I think that there is no connection string in the internal protocol
> used between server core and fbclient.dll/jaybird
> There are probably some structs or sequence of API calls, but not that
> "connection string" ?
> Just out of curiosity, it is not realyl important HOW is that property
> transferred.
> But surely server SHOULD be somehow informed which connection charset
> attached client assumes to have.
> > When you specify NONE encoding, then you explicitly tell
> Stop here. That is not true!!!
> The situation is not when i "explicitly specify NONE".
> The situation is when i, having lack of knowledge, did not specify anything.
> So the correct wording would be:
> "When user does not specify NONE encoding, then he implicitly tell
> server to perform no translation and hope that client will get it
> right."
> Yeah ? i implicitly tell *database* server to hope. Implicitly. To
> hope. Kill me baby.
> > right. It is a powerful mechanism to solve some problems in
> > heterogenous environments, but when you use it wrong, you can make
> > database unusable.
> Exactly. And as such this mechanism should NEVER be engaged by
> accident. Only purposedly.
> And curently, if connection is not specified, you treat it as specified NONE.
> And then FB chooses to play-by-rulebook.
> And then JB chooses to play-by-guessing.
> Hilarity ensues. :-/
> ------------------------------------
> Yahoo! Groups Links