Subject Re: Diacritic characters in TIB_Query.SQL
Author coderefectory
I added two new fields in my table 'Person' -> 'NameBIN' and 'LastNameBIN'.
This function make conversion (name, last name) to binary string to new fields...then serach critera work fine with any diacritical characters situation.


function StrToBin(const S: string): string;
const
BitArray: array[0..15] of string =
('0000', '0001', '0010', '0011',
'0100', '0101', '0110', '0111',
'1000', '1001', '1010', '1011',
'1100', '1101', '1110', '1111');
var
Index: Integer;
LoBits: Byte;
HiBits: Byte;
begin
Result := '';
for Index := 1 to Length(S) do
begin
HiBits := (Byte( S[Index]) and $F0) shr 4;
LoBits := Byte( S[Index]) and $0F;
Result := Result + BitArray[HiBits];
Result := Result + BitArray[LoBits];
end;
end;




--- In IBObjects@yahoogroups.com, "coderefectory" <coderefectory@...> wrote:
>
> In this case code in EXE doesn't work in (IBO 4.6B components)...I haven't result when names ending with diacritic characters or when they have diacritic in the midle of the name...I don't use IBO_Search component...
>
> qrMembers.SQL.Clear;
>
> qrMembers.SQL.Add(FMemberSQL + ' and UPPER("Person"."LastName")
> starting with UPPER(:SEARCH_CRITERIA);');
>
> qrMembers.ParamByName('SEARCH_CRITERIA').AsString :=
> TrimRight(AnsiUpperCase(edSEARCH.Text));
>
> qrMembers.Close;
> qrMembers.Open;
>
>
> But this work with diacritic in IBExpert:
>
>
> select * from "Person"
> where
> UPPER("Person"."LastName") starting with UPPER( :SEARCH_CRITERIA )
>