Unicode string in CLOB
Posted: Fri 23 Jun 2006 16:25
Hello,
we have some problems displaying unicode strings stored in CLOB, international characters (arabian,russian,...) are displayed as ???????. Strings are read through TOraQuery and displayed in TTntDBMemo component. VARCHAR2 columns are displayed correctly, only CLOB seems to be a problem.
We use Delphi 7, ODAC 5.70.1.33, OCI 9.2.0.5.0, Server: Oracle 9.2.0.6.0
TOraSession settings:
CharLength := 0;
Charset := '';
UseUnicode := True;
Net := False;
it appears to me that TBLOBField doesn't handle unicode strings correctly, so I tried to read it with following code:
as a result, I get string where first half is scrambled and second half is ok (international characters displayed correctly)
does anybody know how to read unicode strings from CLOB correctly?
thanx in advance
Tomas
we have some problems displaying unicode strings stored in CLOB, international characters (arabian,russian,...) are displayed as ???????. Strings are read through TOraQuery and displayed in TTntDBMemo component. VARCHAR2 columns are displayed correctly, only CLOB seems to be a problem.
We use Delphi 7, ODAC 5.70.1.33, OCI 9.2.0.5.0, Server: Oracle 9.2.0.6.0
TOraSession settings:
CharLength := 0;
Charset := '';
UseUnicode := True;
Net := False;
it appears to me that TBLOBField doesn't handle unicode strings correctly, so I tried to read it with following code:
Code: Select all
function TMyBLOBField.GetAsWideString: WideString;
var
Len: Integer;
begin
with DataSet.CreateBlobStream(Self, bmRead) do
try
Len := Size;
SetLength(Result,Len);
ReadBuffer(Pointer(Result)^, Len);
finally
Free;
end;
end;
does anybody know how to read unicode strings from CLOB correctly?
thanx in advance
Tomas