Subject Re: [Firebird-Java] Re: One Byte Encoders maps unknown chars to 0 instead of '?'
Author Roman Rokytskyy
> I do think it is worth looking how other encoders/decoders handle this,
> because replacing an unprintable or unknown character with a '?' is in
> my eyes a presentation decision that should NOT be handled by an
> encoder, but only by the presentation layer.

The issue with '?' vs 0x00 is that if that 0x00 is written to some
external storage, other application written not in Java might use the
0x00 symbol as end-of-string marker. Whether it is '?' or something else
is rather irrelevant, only that '?' is a symbol that is usually used in
such conversions.

> If other encoders handle it
> like this as well (eg the built in CharSet objects in Java), we should
> follow. On that note, I do think it would be better if Jaybird would
> defer to the standard Java encoders or the Java ICU implementation
> instead of using handrolled encoders.

It was the initial implementation, but one of our developers (long time
ago) have measured about 5% performance increase when using our
handwritten encoders. That might be no longer right, so returning back
to standard Java encoders is an option.

Roman