1 |
< |
unit Test12; |
1 |
> |
unit Test12; |
2 |
> |
{$IFDEF MSWINDOWS} |
3 |
> |
{$DEFINE WINDOWS} |
4 |
> |
{$ENDIF} |
5 |
|
|
6 |
< |
{$mode objfpc}{$H+} |
6 |
> |
{$IFDEF FPC} |
7 |
> |
{$mode delphi} |
8 |
|
|
9 |
|
{$codepage UTF8} |
10 |
+ |
{$ENDIF} |
11 |
|
|
12 |
|
interface |
13 |
|
|
31 |
|
procedure UpdateDatabase(Attachment: IAttachment); |
32 |
|
procedure QueryDatabase(Attachment: IAttachment); |
33 |
|
public |
34 |
< |
function TestTitle: string; override; |
35 |
< |
procedure RunTest(CharSet: string; SQLDialect: integer); override; |
34 |
> |
function TestTitle: AnsiString; override; |
35 |
> |
procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override; |
36 |
|
end; |
37 |
|
|
38 |
|
implementation |
42 |
|
'Create Table TestData ('+ |
43 |
|
'RowID Integer not null,'+ |
44 |
|
'Title VarChar(32) Character Set UTF8,'+ |
45 |
< |
'Notes VarChar(64) Character Set ISO8859_1,'+ |
45 |
> |
'Notes VarChar(64) Character Set ISO8859_1 collate FR_FR,'+ |
46 |
|
'BlobData Blob sub_type 1 Character Set WIN1252, '+ |
47 |
|
'BlobData2 Blob sub_type 1 Character Set UTF8, '+ |
48 |
|
'InClear VarChar(16) Character Set OCTETS, '+ |
67 |
|
with Statement.GetSQLParams do |
68 |
|
begin |
69 |
|
ByName('rowid').AsInteger := 1; |
70 |
+ |
{$IFDEF DCC} |
71 |
+ |
ByName('title').AsString := UTF8Encode('Blob Test ©€'); |
72 |
+ |
ByName('Notes').AsString := UTF8Encode('Écoute moi'); |
73 |
+ |
{$ELSE} |
74 |
|
ByName('title').AsString := 'Blob Test ©€'; |
75 |
|
ByName('Notes').AsString := 'Écoute moi'; |
76 |
+ |
{$ENDIF} |
77 |
|
ByName('BlobData').AsString := 'Some German Special Characters like ÖÄÜöäüß'; |
78 |
|
ByName('BlobData2').AsBlob := Attachment.CreateBlob(Transaction,'TestData','BlobData').SetString('Some German Special Characters like ÖÄÜöäüß'); |
79 |
|
ByName('InClear').AsString := #$01'Test'#$0D#$C3; |
91 |
|
ReportResults(Statement); |
92 |
|
end; |
93 |
|
|
94 |
< |
function TTest12.TestTitle: string; |
94 |
> |
function TTest12.TestTitle: AnsiString; |
95 |
|
begin |
96 |
|
Result := 'Test 12: Character Sets'; |
97 |
|
end; |
98 |
|
|
99 |
< |
procedure TTest12.RunTest(CharSet: string; SQLDialect: integer); |
99 |
> |
procedure TTest12.RunTest(CharSet: AnsiString; SQLDialect: integer); |
100 |
|
var DPB: IDPB; |
101 |
|
Attachment: IAttachment; |
102 |
|
begin |