Subject Re: [IBO] Unusable Alpha Version for Delphi 2009
Author Andreas Hesse
m. Th. schrieb:
> Andreas Hesse wrote:
>> Hello Jason,
>>
>> the last alpha version of IBO 4.9 is really unuseable with Delphi
>> 2009. It doesn't really support unicode.
>>
> Yes.
>
>> AsString must return a string, not an AnsiString.
>>
>
> Take care here!!
>
> This was a very big discussion 'somewhere' :-). I cannot tell you many
> things but due of compatibility reasons - mainly concerns which are tied
> to the fact that many users are storing non-text data (binary etc.)
> using .AsString - the Get/SetAsString uses GetAsAnsiString internally.

Strings for storing Bytes is and was always bad design.
The only reason for this was, because AnsiString is Referece-counted.
But with D2009 it is a very bad design.

> From D2009's DB.PAS:
>
> function TStringField.GetAsString: string;
> begin
> Result := string(GetAsAnsiString);
> end;

AsString returns a string (=UnicodeString)

>
> ....also you can have a look at TStringField.GetValue(var Value:
> AnsiString): boolean;
> and, of course at SetAsString.
>

TStringField is really a TAnsiStringField.
So for using Unicode within DB-Layer we must use TWideStringField.

> The workaround (for the time being) is to use .AsWideString which
> returns an Unicode string.

No, it returns only a Unicoded AnsiString for TStringField.
see above, using TWideStringField is the only possibility.

>
> Also, since the above hard-cast is in DB.Pas (iow outside of our
> control) there will be problems with TIBO layer.

No, Text Fields should be now created as TWideStringField's (if they are
created dynamically).
But I don't check the source for it.

The native TIB_Column does not differ between AnsiString and WideString
Column. It only differ between Fixed Text (Char) and Variable Text
(VarChar) columns.
And if it is a AnsiString or a WideString Field depends on the
connection charset.

>
>> I can send you my last version of IBO for D2009.
>> Not everything is working (TIBO...-Components have problems,
>
> WHAT problems?
>
>> automatic
>> Text-Blob-Conversion is not implemented for FB 2.1, and a few more)
>>
>
> Hmmm... see above.
>> My main design desicions:
>> - drop support for Delphi3/4
>>
>
> +1!!!
>
> Also, perhaps, D5/6 can be dropped. The polls indicate that after D2007
> the vast majority of users are concentrated on D7/D2007. But if someone
> is against please raise the hand.

No, I know that Delphi 5 is still productive.

>
>> - all handling of string conversion will be done at connection level
>> called by the TIB_Column Set/Get-Methods
>> (real conversion between connection charset and system charset)
>> (prefered connection charset is now UTF8)
>>
>>
>
> Take care, as I said, at the problem described above. Did you consider
> to apply for the Weaver beta test? (see http://beta.embarcadero.com)
>

I will look at it.

>> - all string handling will be done with unicode strings
>> (length, uppercase, lowercase, ...)
>>
>>
>
> Agreed.
>
>> In the moment it is only a ansi-fied version of IBO without real
>> unicode support.
>>
>>
> Yes.
>

Any news from Jason?

Andreas