Unicode - DB2
Unicode - DB2
Hi,
I try query during TUniQuery this
SELECT V.VIEWSCHEMA,V.VIEWNAME FROM SYSCAT.VIEWS AS V WHERE V.VIEWNAME='VЖ҉ﻺ۩ﭷѠϢѪϟV'
I have in my DB view with name 'VЖ҉ﻺ۩ﭷѠϢѪϟV', but this query return empty result. When I try only
SELECT V.VIEWSCHEMA,V.VIEWNAME FROM SYSCAT.VIEWS
view is present in result.
I have UseUnicode switch to true.
I don't know what it is wrong.
Thank you for response
I Use Delphi 7. Is it problem? I have problem with TMemoField and unicode too. Is it because I use D7? Any work around?
Daril
I try query during TUniQuery this
SELECT V.VIEWSCHEMA,V.VIEWNAME FROM SYSCAT.VIEWS AS V WHERE V.VIEWNAME='VЖ҉ﻺ۩ﭷѠϢѪϟV'
I have in my DB view with name 'VЖ҉ﻺ۩ﭷѠϢѪϟV', but this query return empty result. When I try only
SELECT V.VIEWSCHEMA,V.VIEWNAME FROM SYSCAT.VIEWS
view is present in result.
I have UseUnicode switch to true.
I don't know what it is wrong.
Thank you for response
I Use Delphi 7. Is it problem? I have problem with TMemoField and unicode too. Is it because I use D7? Any work around?
Daril
Hello,
I discover that with older version of unidac(Unidac version 1.00.0.7 for Delphi 7) I can use unicode character when query.sql code to UTF8.
But when I use new version (Unidac version 4.0.1 for Delphi 7), this not work.
I need this functionality return to our product, because it was implemented with older unidac. Now I tested it on Oracle, but i think it will be same problem as DB2.
Any Ideas why?
I tryed debug program and use query.SaveToXml to compare with older version. I see that in new is empty element: (maybe will be usefull).
Thank you
Petr
I discover that with older version of unidac(Unidac version 1.00.0.7 for Delphi 7) I can use unicode character when query.sql code to UTF8.
But when I use new version (Unidac version 4.0.1 for Delphi 7), this not work.
I need this functionality return to our product, because it was implemented with older unidac. Now I tested it on Oracle, but i think it will be same problem as DB2.
Any Ideas why?
I tryed debug program and use query.SaveToXml to compare with older version. I see that in new is empty element: (maybe will be usefull).
Thank you
Petr
Hi,
Windows: Windows 7 64b
regional settings: United states
I'm not sure which font. I use tntMemo for insert sql statement in both exmaple(old, nee component), font is MS Sans Serif.
I try write UTF-8 string and it is same.
This is code of test program:
It is work with Unidac 1.0.0.7
Petr
Windows: Windows 7 64b
regional settings: United states
I'm not sure which font. I use tntMemo for insert sql statement in both exmaple(old, nee component), font is MS Sans Serif.
I try write UTF-8 string and it is same.
This is code of test program:
Code: Select all
function ConvertWideStringToUtf8(Value: WideString): UTF8String;
var
Temp : UTF8String;
Copied: Integer;
begin
Result := '';
SetLength( Temp, Length( Value ) * 3 );
Copied := UnicodeToUtf8(PChar(Temp), Length(Temp)+1, PWideChar( Value ), Length( Value ));
if Copied > 0 then
begin
SetLength( Temp, Copied-1 );
Result := Temp;
end;
end;
procedure TForm1.TntButton1Click(Sender: TObject);
begin
UniConnection1.Connect;
UniQuery1.SQL.Text := ConvertWideStringToUtf8(TntMemo1.Lines.Text);
Uniquery1.Execute;
end;Petr
Hello,
You are using non-standard third-party components for work with UniDAC symbols. Maybe the problem is due exactly to them, try to reproduce the problem using the standard components.
P.S. When working with Delphi versions that support UniCode (since Delphi 2009), your queries run correctly and return correct datasets
You are using non-standard third-party components for work with UniDAC symbols. Maybe the problem is due exactly to them, try to reproduce the problem using the standard components.
P.S. When working with Delphi versions that support UniCode (since Delphi 2009), your queries run correctly and return correct datasets
Hello,
I use email to reply, because I don’t see how can I post attachments.
In Attachments are two projects. One is with unidac version 1.0 and second with unidac version 4.0(Both are for Delphi 7). You can see code is identical and I use only VCL standard components. With unidac version 1.0 works perfects and I get some results. With unidac version 4.0 I don’t get any results.
Petr
I use email to reply, because I don’t see how can I post attachments.
In Attachments are two projects. One is with unidac version 1.0 and second with unidac version 4.0(Both are for Delphi 7). You can see code is identical and I use only VCL standard components. With unidac version 1.0 works perfects and I get some results. With unidac version 4.0 I don’t get any results.
Petr
Hello,
We have fixed work with the UniCode symbols, and this fix will be available in the next UniDAC version. However, a more correct solution is using parametrized queries, as, in this case, you are not dependent hard from the charset, and you can choose a charset for the concrete symbols specifying it in the UniConnection.SpecificOptions.Value['Charset'] property (for your example, it would be enough to set the charset value as UniConnection.SpecificOptions.Value['Charset'] := 'AL32UTF8';)
We have fixed work with the UniCode symbols, and this fix will be available in the next UniDAC version. However, a more correct solution is using parametrized queries, as, in this case, you are not dependent hard from the charset, and you can choose a charset for the concrete symbols specifying it in the UniConnection.SpecificOptions.Value['Charset'] property (for your example, it would be enough to set the charset value as UniConnection.SpecificOptions.Value['Charset'] := 'AL32UTF8';)
Unicode
Hello Alex,
it is good news for me.
Could yous specify when will be next version with this fix?
I try to use your workaround with charset AL32UTF8. It is works, when set UseUnicode to false. Unfortunatelly result is in utf8 to, but it is only minor problem.
Beause I hurry to solve this problem I tryed during weekend deploy dll in Delphi XE2 with Unidac 4.1. But I see, there is some similar problem with unicode. I don't code query to UTF8 and set UseUnicode to true, but I don't get result, when I use unicode char in where clause. I verified it in simple project in XE2.
XE2 simple project:
Query: Select * from TestUnicodeDaril Where Name='Ѫϟ'
Connection Options: UseUnicode := True;
Direct := True;
Charset := '';
Could you confirm please that is same problem as in Delphi7? If yes I know, that work around by dll is not solution for me.
Thank you
Petr
it is good news for me.
Could yous specify when will be next version with this fix?
I try to use your workaround with charset AL32UTF8. It is works, when set UseUnicode to false. Unfortunatelly result is in utf8 to, but it is only minor problem.
Beause I hurry to solve this problem I tryed during weekend deploy dll in Delphi XE2 with Unidac 4.1. But I see, there is some similar problem with unicode. I don't code query to UTF8 and set UseUnicode to true, but I don't get result, when I use unicode char in where clause. I verified it in simple project in XE2.
XE2 simple project:
Query: Select * from TestUnicodeDaril Where Name='Ѫϟ'
Connection Options: UseUnicode := True;
Direct := True;
Charset := '';
Code: Select all
...
UniConnection1.Server := EdServer.Text;
UniConnection1.Connect;
if UniConnection1.Connected then
begin
UniQuery1.SQL.Text := Select * from TestUnicodeDaril Where Name=''Ѫϟ'';
UniQuery1.Execute;
end;
...Could you confirm please that is same problem as in Delphi7? If yes I know, that work around by dll is not solution for me.
Thank you
Petr