Subject Re: [Firebird-Java] Re: Trying to run TrackStudio :-)
Author Roman Rokytskyy
The default encoding in Firebird, when nothing is specified, is NONE.
It applies to every client library regardless of language.

In Java, default encoding for byte array to Unicode conversion is the
system's default encoding (on Windows it corresponds to your regional
setting, on Linux it might be anything). One possibility would be to
specify system's default encoding as a connection encoding, however
that would for sure break setups where database default encoding is NONE.

We cannot assume UTF-16 for raw data because of heterogenity. As far as
I know, almost every Delphi or C++ library uses one-byte strings, not
Unicode ones. Java applications account for about 6% of Firebird
market, so we have to obey their rules.

So, maybe we should really deny the connection, when nothing is specified...

Roman


Gesendet mit AquaMail für Android
http://www.aqua-mail.com

Am 29. Juni 2012 10:01:13 schrieb "the_a_rioch" <ariochthe@...>:
> > The problem is that defaulting to UTF8 will not always work fine,
> > especially not if the database connected to is not UTF8.
>
> why ? doesn't server know what charset of connection is ?
> FB 1.x would just refuse.
> FB 2.x would transcode to UTF-8 server-side, won't it ?
>
> Or is this dependent upon use fbclient.dll vs direct internal protocol?
>
> > However maybe a more intelligent algorithm for deciding on the
> > characterset is possible (eg when NONE is used, try to use the
>
> I still think that as 0-vs-NULL.
> * If "NONE" is *specified* - then obey and do NO transcoding at all.
> Raw UTF-16. There is no situation we would think it is reasonable, but
> we don;t have all the world's wisdom. So if there is some braindead
> geek wanting to shoot his feet - he is warned and given the gun.
> If (sorry for pun) *none* was specified - just no that property at all
> - then do most flexible or most adaptable thing as heuristics OR deny
> connection and ask user to read documentation, sine that setting is
> important and incorrectly set might corrupt his database in long run.
>
> > encoding). I created http://tracker.firebirdsql.org/browse/JDBC-257 to
> > look into this.
>
> i don't have tracker password here, maybe would later.
> I just think link to this discussion is to be added there, so that
> people could follow why the question was started and what different
> opinions to be there.
>
> Thanks for clarifying those things to me.
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>