Subject Re: [firebird-support] Dear friends - Varchar size
Author Ann W. Harrison
Here's the situation in 1.5, as I understand it.

If you declare a varchar(10) with no character set
or a single byte character set, Firebird allocates
10 bytes (plus two bytes of length) and you can
store up to 10 single byte characters.

If you declare a varchar(10) specifying a two-
byte character set, Firebird allocates 20 bytes
plus the same two byte length) and you can store
up to 10 two-byte characters.


If you declare a varchar(10) and specify a
variable length character set (e.g. UNICODE_FSS)
Firebird allocated a 30 byte space plus the two
length bytes. Firebird checks the byte length
of the stored string, not the character length,
so you can store up to 30 single byte characters,
up to 15 two-byte characters, up to 10 three byte
characters, and 7 four byte characters. You can
also mix and match ... 6 single byte characters
plus 5 three byte characters, plus 4 two byte
characters...

Regards,


Ann