![]() |
IdHTTP.Get Unicode
Hi,
folgendes kleines Beispielprogramm compilliert mit Delphi 2010:
Delphi-Quellcode:
Problem ist, dass, egal welchen Webseitenquelltext ich lade, nur Mist rauskommt. Showmessage zeigt 2 Kästchen, wenn man debugt steht in html
unit Unit1;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdHTTP; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var html: string; begin with TidHTTP.Create do try html := Get('http://www.web.de'); // oder andere Seiten showmessage(html); finally Free; end; end; end. Zitat:
Jemand eine Idee an was das liegen könnte? Dominik |
AW: IdHTTP.Get Unicode
Delphi-Quellcode:
procedure TForm2.FormShow(Sender: TObject);
var html: string; begin html := http.Get('http://www.web.de'); // oder andere Seiten showmessage(html); end; http ist komponente TIdHttp. Funktioniert einwandfrei unter D2010 |
AW: IdHTTP.Get Unicode
Zitat:
|
AW: IdHTTP.Get Unicode
Hast du schon einmal meinen Code ausprobiert ohne "With"?
|
AW: IdHTTP.Get Unicode
Ja, im eigentlichen Projekt habe ich das auch mit einer Variablen gemacht, aber das ist gehopst wie gesprungen.
Delphi-Quellcode:
Trotzdem Danke für deine Hilfe!
procedure TForm1.Button1Click(Sender: TObject);
var html: string; http: TIdHTTP; begin http := TIdHTTP.Create(self); try html := http.Get('http://www.web.de'); // oder andere Seiten finally http.Free; end; showmessage(html); end; |
AW: IdHTTP.Get Unicode
Da es Probleme bei der Indy-Version, die bei Delphi 2010 mitgeliefert wurde, geben soll habe ich mal ein Update mit dem aktuellen Snapshot gemacht (
![]() Ändert leider nichts. Ist das ein Unicode-Problem? |
AW: IdHTTP.Get Unicode
Was passiert, wenn du html als AnsiString deklarierst?
|
AW: IdHTTP.Get Unicode
Inhalt wenn html als String deklariert ist:
Zitat:
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:33 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz