Registriert seit: 6. Mär 2013
6.156 Beiträge
Delphi 10 Seattle Enterprise
|
AW: Mal wieder Unicode
14. Nov 2016, 16:41
DecodeString(..) statt Decode(..)
Delphi-Quellcode:
program Project17;
{$APPTYPE CONSOLE}
{$R *.res}
uses System.SysUtils, IdGlobal, IdCoder, IdCoderQuotedPrintable;
const
input = '=?UTF-8?Q?Heiko_L=C3=BCttge?';
var
encoder: TIdDecoder;
encoding: IIdTextEncoding;
begin
encoding := IndyTextEncoding_UTF8();
// oder encoding := IndyTextEncoding(TEncoding.UTF8);
encoder := TIdDecoderQuotedPrintable.Create(nil);
try
Write(input);
Write(' -> ');
Write( encoder.DecodeString(input, encoding) );
finally
encoder.Destroy();
end;
readln;
end.
=>
Code:
=?UTF-8?Q?Heiko_L=C3=BCttge? -> ?UTF-8?Q?Heiko_Lüttge?
|