Subject Re: [Firebird-Java] Re: Java CharSet to Firebird CharSet
Author Mark Rotteveel
On Sun, 12 Aug 2012 19:38:46 -0000, "Fabiano"
> It is done, Mark.
> BTW, is it correct to connect to Firebird using always the "UTF-8"
> charset, independent of the charset used by the O.S? I read somewhere
> despite the charset the O.S is using, Java always use UTF-16, and it
> doesn´t matter if i connect with ISO-8859-1, UTF-8 or other, jaybird
> always convert from UTF-16 (Java) to connection charset "before" sending
> something to the server.

Java uses the unicode characterset, and in memory that is encoded as
UTF-16, but that is (almost always) irrelevant to you as a developer in
Java. The reason that Java has a 'default' characterset linked to the
characterset of the OS is mostly a leftover from Java 1.0.

When using Jaybird you could always connect using UTF8, however that can
be a bit wasteful if your database uses a specific single byte characterset
as you are more likely to send and receive more bytes compared to using the
specific characterset. However if you need the full gamma of Unicode
characters, then you are better off using UTF8 always (and your database
should too).