Subject Re: [Firebird-Java] Re: Performance bug located and solved
Author Blas Rodriguez Somoza
Hello

> I have a database which I set encode to NONE as it contains client
> information from the web which I don't know what languages they are.
>
> Therefore, I stored the contents as it is without encoding. It works
> fine when I retrieve them using Delphi. That is the information
> retrieved is same as clients submitted.
>

How does Delphi know the character set it must use to translate bytes into characters?

> However, using JBird the retrieved contents altered with special
> characters. By the way, I did not specify encodes.
>
> Are there any way to keep the contents/characters as it is using java?
>

When you use java, if you don't specify a character set, you will get the conversion as it the bytes you receive are in the
default encoding of the platform. For windows this is WIN1252.

If you work with the information as bytes without converting it to characters, you don't modify the information.

The only way to avoid those kind of problems, if you work with the information as characters, is to know at the browser and
server side which encoding you are using.

When you work with the web information, you will need to specify the character set in the pages. So the browser, if it don't has
a bug, send the information encoded properly. You can use several character sets or work with UTF-8.

On the other side, the servlets sometimes has problems to know the encoding of the incoming information. If you work with
servlets API version 2.3 you can use setCharacterEncoding, but with previous versions you must employ some tricks.

Regards
Blas Rodriguez Somoza