Selaa lähdekoodia

* WideStringManager needed

Michael VAN CANNEYT 2 vuotta sitten
vanhempi
commit
ddb25669c7

+ 6 - 0
packages/fcl-web/examples/httpclient/httpget.pas

@@ -4,6 +4,9 @@ program httpget;
 {$DEFINE USEGNUTLS}
 
 uses
+  {$IFDEF UNIX}
+  fpwidestring, unicodeducet,
+  {$ENDIF}
   SysUtils, Classes, fphttpclient, ssockets,
 {$IFNDEF USEGNUTLS}
   fpopenssl, opensslsockets,
@@ -141,6 +144,9 @@ begin
 end;
 
 begin
+  {$IFDEF UNIX}
+  SetActiveCollation('DUCET');
+  {$ENDIF}
   With TTestApp.Create do
     try
       Run;

+ 6 - 1
packages/fcl-web/examples/httpclient/httppost.pp

@@ -9,6 +9,8 @@ Var
   F : TFileStream;
   Vars : TStrings;
   i : integer;
+  Fmt : UNicodeString;
+
 begin
   With TFPHTTPClient.Create(Nil) do
     begin
@@ -17,7 +19,10 @@ begin
       Vars:=TstringList.Create;
       try
         For i:=1 to 10 do
-          Vars.Add(Format('Var%d=Value %d',[i,i]));
+          begin
+          Fmt:='Var%d=Value %d';
+          Vars.Add(Format(Fmt,[i,i]));
+          end;
         FormPost(ParamStr(1),vars,f);
       finally
         Vars.Free;

+ 5 - 1
packages/fcl-web/examples/httpclient/httppostfile.pp

@@ -1,14 +1,18 @@
 program httppostfile;
 
+
 {$mode objfpc}{$H+}
 
 uses
+  {$ifdef unix}
+  cwstring,
+  {$endif}
   SysUtils, Classes, fphttpclient, opensslsockets;
 
 Var
   F : TFileStream;
   Vars : TStrings;
-  i : integer;
+
 begin
   With TFPHTTPClient.Create(Nil) do
     begin