Subject Re: Connection charset UTF8, column charset ASCII: right padded char fields
Author skoczian
--- In firebird-support@yahoogroups.com, Dmitry Yemanov <dimitr@...>
wrote:
>
> skoczian wrote:
> >
> > I've seen the discussion about right padded char(n) fields sent
from
> > the Firebird server if the field has character set UTF8. But
even if
> > a char column with fixed length is declared with character set
ASCII
> > the clients I've used seem to pad it with blanks, if the
connection
> > character set is UTF8. Is that right? I could understand it for
> > columns declared as, say, ISO8859_1, because transliteration to
UTF8
> > might need more bytes. But that can't happen with an ASCII
column,
> > so why those blanks?
>
> It's not related to charsets. CHAR values are always space-padded,
even
> when stored inside the database (although compressed).
>

Oh, sorry, I see that I forgot to say: the fields aren't padded to
their declared length, they are padded to 4 times this length (which
seems to be normal for UTF8). One character, 3 spaces for a column
declared as CHAR(1) CHARACTER SET ASCII.

Herta