Search results for 'MIME Type Encoding'. 1 post(s) found.
- 2009/07/16 Base64 Encoding/Decoding function for Delphi
Base64Encoding function is frequently used in MIME Type based programming. Here's the good resource for supporting Base64Encode and Base64Decode.
uses IdCoder, IdCoder3to4, IdCoderMIME, jpeg;
function Base64Decode(const Text : ansiString): ansiString;
var
Decoder : TIdDecoderMime;
begin
Decoder := TIdDecoderMime.Create(nil);
try
Result := Decoder.DecodeString(Text);
finally
FreeAndNil(Decoder)
end
end;
function Base64Encode(const Text : ansiString): ansiString;
var
Encoder : TIdEncoderMime;
begin
Encoder := TIdEncoderMime.Create(nil);
try
Result := Encoder.EncodeString(Text);
finally
FreeAndNil(Encoder);
end
end;
function Base64Decode(const Text : ansiString): ansiString;
var
Decoder : TIdDecoderMime;
begin
Decoder := TIdDecoderMime.Create(nil);
try
Result := Decoder.DecodeString(Text);
finally
FreeAndNil(Decoder)
end
end;
function Base64Encode(const Text : ansiString): ansiString;
var
Encoder : TIdEncoderMime;
begin
Encoder := TIdEncoderMime.Create(nil);
try
Result := Encoder.EncodeString(Text);
finally
FreeAndNil(Encoder);
end
end;
I verified above functions on Delphi 2009.
Another posts included in "Delphi"
| How to encode subject content when sending mail with TIdMessage ? (0) | 2009/07/16 |
| How to send text/html based email in UTF-8 with TIdSMTP, TIdMessage VCL (0) | 2009/07/20 |
| When subject is crashing in TIdSMTP VCL (0) | 2009/07/20 |
| How to send email by TIdSMTP VCL ? (0) | 2009/07/07 |
| How to return exit code such as exit() function in C/C++ ? (0) | 2009/07/02 |
| How to get parameter string ? (0) | 2009/06/30 |
| Save TBitmap image to Jpeg format image in Delphi (0) | 2009/06/26 |
| How to get screen resolution in case of using multiple monitors ? (0) | 2008/12/16 |

Prev

Rss Feed