Subject Re: [IBO] Re: Unicode utf-8 Widestring - does not work as expected
Author Jason Wharton
I have a version you can test right now.
It uses UTF8.

Contact me privately and I'll include you in those I am working with.

Jason

----- Original Message -----
From: "Maik Wojcieszak" <mw@...>
To: <IBObjects@yahoogroups.com>
Sent: Friday, February 25, 2011 12:08 AM
Subject: AW: [IBO] Re: Unicode utf-8 Widestring - does not work as expected


Hi Sven,

I am very happy to hear that you are working on this problem together with
Jason.
By now we are trying to work around this because we are blocked to release
our software with Unicode support.
If we successfully fix the few functions we use from IBO we get some time.
Time is a very
important factor for us. When do you expect to have a working version ?
(This is more a less a question for Jason).

Please let me know if we can assist.

Best Regards,
Maik


Von: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] Im Auftrag
von fescher
Gesendet: Donnerstag, 24. Februar 2011 12:56
An: IBObjects@yahoogroups.com
Betreff: [IBO] Re: Unicode utf-8 Widestring - does not work as expected



Hi Maik,

we are facing exactly the same problem with the same configuration and have
also been analysing the issue. We are already in contact with Jason
regarding this. There is more to change in the IB_Parse and IB_Grid for
Unicode to work correctly.
Doing an SQL like "SELECT ID FROM CUSTOMER WHERE NAME LIKE '%æîí%'" would
also work then.

If you have a look in IB_Parse at line 22683 you can find this:

Result := isc_dsql_prepare( @status,
PtrHandle,
PstHandle,
null_terminated,
PByte( Text ),
SQLDialect,
IB_Session.FOutDa );

instead of something like this:

function API_Prepare( Text: String;
var InVar,
OutVar: smallint ): integer; virtual;

if IB_Connection.CharSet = IBO_UTF8 then
Result := isc_dsql_prepare( @status,
PtrHandle,
PstHandle,
null_terminated,
PByte( UTF8Encode(Text) ),
SQLDialect,
IB_Session.FOutDa )
else
Result := isc_dsql_prepare( @status,
PtrHandle,
PstHandle,
null_terminated,
PByte( AnsiString(Text) ),
SQLDialect,
IB_Session.FOutDa );

Is I already mentionned above, we know Jason for 15 years and are closely
working with him on the Unicode port right now.

Best regards

Sven
www.sita.lu

--- In IBObjects@yahoogroups.com<mailto:IBObjects%40yahoogroups.com>, Maik
Wojcieszak <mw@...> wrote:
>
> I'm using IBObjects 4.9.11 with an UTF8 charset in a Firebird database.
> There are problems storing and reading strings with Delphi 2010 (Unicode
> strings).
> In the Fields there are functions/properties called "AsString"
> (AnsiString) and "AsWideString" (WideString).
> Both functions don't work properly with the new Delphi Unicode strings.
> Chinese chars doesn't pass this functions properly, storage as UTF8 in
> Database doesn't work fine.
> I took a look in the IB_Components.pas unit and wonder about the string
> handling there.
> In line 44810 for example is a call to "UTF8Decode", which returns a
> WideString, but it will be forced afterwards to AnsiString!
> That's not good. There should be a WideString type of GetAsString
> returning the direct output of "UTF8Decode".
> The functions "Get-/SetAsWideString" sound like the desired functionality,
> but they hasn't a correct string handling
> and I think they cannot be touched because of downward compatibility.
>
> The existing "Get-/SetAsString" functions should be renamed to
> "Get-/SetAsAnsiString" and
> the Unicode versions should be the new "Get-/SetAsString".
>
> Maybe like this: (functions are simplified)
>
> function TIB_Column(Var)Text.GetAsString: string;
> begin
> if FNewColumnInd^ = IB_NULL then
> Result := ''
> else
> begin
> if Statement.IB_Connection.CharSet = IBO_UTF8 then
> Result := UTF8ToString(Value) // deprecated: UTF8Decode(Value)
> else
> ...
> end;
> end;
>
> procedure TIB_Column(Var)Text.SetAsString(const NewValue: string);
> begin
> if Statement.IB_Connection.CharSet = IBO_UTF8 then
> Value := UTF8Encode(NewValue)
> else
> ...
> end;
>
> Any idea - somebody ?
> Regards,
> Maik
>
>
>
> [Non-text portions of this message have been removed]
>



[Non-text portions of this message have been removed]



------------------------------------

___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links