Hi,
i used unidac 5.0.1 with postgresql and i have problem with french accent like â é.
my tuniconnection parameters are: charset UTF8 and useunicode set to true;
Delphi 2007.
no problem before with unidac latest vers 4.
regards
Unidac 5.0.1 and unicode
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Unidac 5.0.1 and unicode
Hello.
I can't reproduce the problem. I used the following code:
Please check this code. If the problem doesn't repeat, edit it, so that the problem repeats.
I can't reproduce the problem. I used the following code:
Code: Select all
{$APPTYPE CONSOLE}
uses
Uni, PostgreSQLUniProvider, Dialogs;
var
UConn: TUniConnection;
UQ: TUniQuery;
begin
UConn := TUniConnection.Create(Nil);
try
UConn.ProviderName := 'PostgreSQL';
UConn.Server := 'db';
UConn.Port := 5438;
UConn.Username := 'postgres';
UConn.Password := 'postgres';
UConn.Database := 'deimos_db';
UConn.SpecificOptions.Values['PostgreSQL.UseUnicode'] := 'True';
UConn.Open;
UQ := TUniQuery.Create(Nil);
try
UQ.Connection := UConn;
UQ.SQL.Text := 'select ''â é'' as txt';
UQ.Open;
ShowMessage(UQ.Fields[0].AsString);
finally
UQ.Free;
end;
finally
UConn.Free;
end;
end.Re: Unidac 5.0.1 and unicode
hi, when i execute this code i have message like this:
â é
regards
â é
regards
Re: Unidac 5.0.1 and unicode
i compil vers 5.0.1 with the make found in folder /source/delphi11 without change in file dac.inc.
have you try with delphi 2007?
regards
have you try with delphi 2007?
regards
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: Unidac 5.0.1 and unicode
Hello.
Delphi 2009 and higher versions have full Unicode support. All previous versions (including Delphi 2007) do not support Unicode. It means that you cannot work with Unicode characters in the standard visual components. That's why, if you want to work with Unicode characters, you should use at least Delphi 2009.
If you need to work with Unicode in Delphi 2007, you should encode and decode the Unicode text by yourself, for example:
Delphi 2009 and higher versions have full Unicode support. All previous versions (including Delphi 2007) do not support Unicode. It means that you cannot work with Unicode characters in the standard visual components. That's why, if you want to work with Unicode characters, you should use at least Delphi 2009.
If you need to work with Unicode in Delphi 2007, you should encode and decode the Unicode text by yourself, for example:
Code: Select all
var
wstring: WideString;
begin
UniQuery1.SQL.Text := 'select txt from testTable';
UniQuery1.Execute;
wstring := Utf8Decode(UniQuery1.FieldByName('txt').AsString);
MessageBoxW(0,PWideChar(wstring),'',0);
end;