![]() |
UTF8 Codierung?
Möchte 'unm%C3%B6glich' in eine "leserliche" Form bringen. (-> 'unmöglich' )
Delphi-Quellcode:
funktioniert nicht.
Utf8ToAnsi('unm%C3%B6glich')
Welche Funktion kann ich dafür verwenden? Auch probiert: HTTPDecode. Geht aber auch nicht. |
Re: UTF8 Codierung?
dein string ist url encodiert
Delphi-Quellcode:
caption:=UTF8Decode( TIdURI.URLDecode('unm%C3%B6glich') );
edit: codetags |
Re: UTF8 Codierung?
Mein TIDURL kenn leider die URLDecode nicht. (alte indy version)
wenn ich's so mache, gib't eine AV:
Delphi-Quellcode:
UTF8Decode(URLDecode('unm%C3%B6glich'))
function URLDecode(ASrc: string): string;
var i: integer; ESC: string[2]; CharCode: integer; begin Result := ''; {Do not Localize} i := 1; while i <= Length(ASrc) do begin if ASrc[i] <> '%' then begin {do not localize} Result := Result + ASrc[i] end else begin Inc(i); // skip the % char ESC := Copy(ASrc, i, 2); // Copy the escape code Inc(i, 1); // Then skip it. try CharCode := StrToInt('$' + ESC); {do not localize} Result := Result + Char(CharCode); except end; end; Inc(i); end; end; |
Re: UTF8 Codierung?
hat jetzt doch funktioniert..(Habe einen rekursiven Aufruf gemacht...)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:24 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 by Thomas Breitkreuz