Subject Re: [firebird-support] Bug with character sets
Author Thomas Steinmaurer
>>>> I'm using FirebirdCS 2.1.2 on SuSE 11.1 Linux and I create a database
>>>> specifying the default character set to be UTF8. I then connect to
>>>> the database and specify that I'll be using UTF8 for the connection.
>>>> If I then select on any "char" type column, I get back a string that
>>>> is 4 times the length it should be and blank padded.
>>>>
>>>> So for instance if I have a char(1) column and store 'Y' or 'N' in it
>>>> and select on it, I get back 'Y ' or 'N '. The problem doesn't
>>>> happen with varchar columns and if I change the character set used for
>>>> the connection to ISO8859_1, then the problem goes away.
>>>>
>>>> I expect that if the database is UTF8 and I'm talking UTF8 to the
>>>> server and I store 'Y' in a char(1) column, when I select from it I
>>>> should get 'Y' back again!
>>>>
>>>> PS: this is all using the C fbclient library and I'm setting the
>>>> connection character set using isc_dpb_lc_ctype in my connection
>>>> parameters.
>>> I've seen this when using IBObjects, can someone else confirm this too?
>> Both, DBW and isql give the following result:
>>
>> ax
>>
>>
>> when doing the following query:
>>
>> select c || 'x' from t2
>>
>>
>> where c is a CHAR(1) in a UTF8 database. Firebird 2.1.2.
>
> But when using || 'x', does this stay a CHAR or does it become
> VARCHAR?

At least trailing spaces in the field c should be preserved, if there
are any, right?

So, a:

select c || 'x' from t2


could have as output, e.g.

a x


if there are 2 trailing spaces.




--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/