Einzelnen Beitrag anzeigen

Benutzerbild von Samashy
Samashy

Registriert seit: 20. Feb 2004
Ort: Cottbus
127 Beiträge
 
Delphi 10.4 Sydney
 
#1

UTF ä und ß hintereinander , ß wird nicht encoded

  Alt 17. Sep 2018, 15:09
Ich erhalte eine Email mit einem UTF codierten Betreff: '=?UTF-8?Q?Planm=C3=A4=C3=9Fige_Erh=C3=B6hung_xx-xx-xx?=

Code:
while Pos('=?UTF-8',Dump)<>0 do
   begin
     StartPos:=Pos('=?UTF-8',Dump)+10;
     EndPos:=PosEx('?=',Dump,startpos+10);
     Encoded:=Encoded+Copy(Dump,StartPos,EndPos-StartPos);
     Dump:=Encoded+Copy(Dump,EndPos+3,Length(Dump)-(EndPos+2));
   end;
   Result:=Encoded;
Ich entferne die UTF ControllStrings und benutze dann TIdDecoderQuotedPrintable
Code:
 
Decoder :=TIdDecoderQuotedPrintable.Create;
versuch1:=Decoder.DecodeString(TRIM(betreff));
ergebnis:=UTF8ToWideString(versuch1);
Ergebnis:
versuch1 = 'PlanmäÃ'#$009F'ige_Erhöhung_xx-xx-xx'
ergebnis = 'Planmä�?ige_Erhöhung_xx-xx-xx'

Was mache ich falsch? ß wird einfach nicht gewandelt, obwohl es meiner Meinung nach richtig geliefert wird. (=C3=9F)

Geändert von Samashy (17. Sep 2018 um 15:12 Uhr)
  Mit Zitat antworten Zitat