AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi IdPOP3, UTF-8 Charset, Umlaute äöü
Thema durchsuchen
Ansicht
Themen-Optionen

IdPOP3, UTF-8 Charset, Umlaute äöü

Ein Thema von MicAlter · begonnen am 29. Apr 2009 · letzter Beitrag vom 14. Mär 2012
Antwort Antwort
MicAlter

Registriert seit: 29. Aug 2007
12 Beiträge
 
#1

Re: IdPOP3, UTF-8 Charset, Umlaute äöü

  Alt 29. Apr 2009, 18:27
Und nun mal in sauber(er)


Delphi-Quellcode:
uses ..., IdCoderQuotedPrintable, JclUnicode;

    var sBody : WideString;

    function ConvertQuotedPrintable( AText : String ) : String;
    var Decoder : TIdDecoderQuotedPrintable;
    begin
      Decoder := TIdDecoderQuotedPrintable.Create(nil);
      try
        Result := Decoder.DecodeToString( AText );
      finally
        FreeAndNil( Decoder );
      end;
    end;

    function ConvertUTF8( AText : WideString ) : WideString;
    begin
      Result := UTF8ToWideString(AText);
    end;

    if Pos( 'quoted-printable', IdMessage.ContentTransferEncoding ) > 0 then
       sBody := ConvertQuotedPrintable(IdMessage.Body.Text)
    else
      sBody := IdMessage.Body.Text;

    if Pos( 'utf-8', IdMessage.ContentType ) > 0 then
       sBody := ConvertUTF8(sBody);
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:34 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