🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.delphi
5 messages
5 total messages Started by konsul41 Fri, 27 Apr 2018 09:50
Kodowanie znaków
#346584
Author: konsul41
Date: Fri, 27 Apr 2018 09:50
32 lines
1898 bytes
IDHttp
result to string

wysyłanie
   Cli.Request.CharSet := 'UTF-8';
   Cli.Request.Connection := 'Keep-Alive';
   Cli.Request.Accept := 'application/soap+xml';
   Cli.Request.ContentType := 'application/soap+xml';
   Cli.Request.AcceptEncoding := 'gzip,deflate';
   Cli.Request.Host := 'wyszukiwarkaregon.stat.gov.pl';
   Cli.Request.Referer := URL;
   Cli.Request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)';
   Cli.HTTPOptions := [];
   Cli.Request.Method := 'POST';

result :=Cli.Post(URL, strm);

Dostaję odpowiedź ale widzę krzaczki.

Treśc odpowiedzi.


Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="application soap+xm

...
     M. Łomża
     Łomża&



Jak to przekonwertować na prawidłowe znaki?
Re: Kodowanie znaków
#346585
Author: Romek
Date: Fri, 27 Apr 2018 10:20
7 lines
1473 bytes
Spróbuj:

TEncoding.Convert(...)



Romek
Re: Kodowanie znaków
#346586
Author: konsul41
Date: Fri, 27 Apr 2018 11:51
40 lines
2085 bytes
W dniu 27-04-2018 o 12:20, Romek pisze:
> Spróbuj:
> 
> TEncoding.Convert(...)
> 
> 
> 
> Romek
> 

const tab : array[1..11]  of Integer = ( 
1252,1250,1257,1251,1256,1253,1255,1254,874 ,1257,1258);
var
   i, j,li: Integer;
   Bytes : TBytes;
   res   : string;
begin
   mmo2.Lines.Clear;
   pb1.Max:=11;
   pb2.Max:=15000;
   for i := 1 to 11 do
   begin
     pb1.Position:=i;
     for j := 0 to 15000 do
     begin
       pb2.Position:=j;
       Application.ProcessMessages;
       try
         Bytes := TEncoding.GetEncoding(tab[i]).GetBytes('SPÓŁKA JAWNA');
         mmo2.Lines.Add('from ' + IntToStr(li) + ' to ' + IntToStr(j)+' 
'+TEncoding.GetEncoding(j).GetString(Bytes))

       except
         on E: Exception do

       end;
     end;
   end;
end;
Ale bez rezultatu.
Re: Kodowanie znaków
#346587
Author: konsul41
Date: Fri, 27 Apr 2018 12:17
21 lines
1596 bytes
Nagłówek zwrotny
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"

ale IDHTTP ma Response.CharSet
ISO-8859-1
czy nie tutaj jest problem?


znowu Response.RawHeaders.Text;

Connection: close
Content-Length: 1405
Date: Fri, 27 Apr 2018 12:17:09 GMT
Content-Type: multipart/related; 
type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:274992ab-e642-4142-92e5-bfd0a4e06031+id=123284";start-info="application/soap+xml"
Server: Microsoft-IIS/7.5
Cache-Control: private
X-AspNet-Version: 2.0.50727
MIME-Version: 1.0
X-Powered-By: ASP.NET
Re: Kodowanie znaków
#346588
Author: konsul41
Date: Fri, 27 Apr 2018 12:20
13 lines
1445 bytes
W dniu 27-04-2018 o 14:17, konsul41@wp.pl pisze:
> Nagłówek zwrotny
> Content-Transfer-Encoding: 8bit
> Content-Type: application/xop+xml;charset=utf-8;type="application/soap+xml"
> 
> ale IDHTTP ma Response.CharSet
> ISO-8859-1
> czy nie tutaj jest problem?
I chyba tutaj był problem ponieważ:
Cli.Response.CharSet:='UTF-8';
     res := Cli.Post(URL, strm);
dostaje
Łomża
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads