| Subject | Re: [firebird-support] Bug with character sets | 
|---|---|
| Author | Ann W. Harrison | 
| Post date | 2009-05-19T19:09:54Z | 
Martijn,
that many characters. So the actual stored character length
is passed for a VARCHAR. The buffer is fixed size and
probably padded with spaces.
does not. Perhaps the easiest solution is to cast all strings
to VARCHAR if you're using a multi-byte (and especially a
variable length multi-byte) character set.
Cheers,
Ann
            >Yes.
> Then what does it transfer? The server know how many characters
> there are, doesn't it?
>A VARCHAR is passed as two bytes of character length, plus
> How does this work for VARCHAR?
that many characters. So the actual stored character length
is passed for a VARCHAR. The buffer is fixed size and
probably padded with spaces.
>Both are padded. VARCHAR has the character length. CHAR
> Why is the CHAR buffer padded, but it seems VARCHAR isn't?
does not. Perhaps the easiest solution is to cast all strings
to VARCHAR if you're using a multi-byte (and especially a
variable length multi-byte) character set.
Cheers,
Ann