2010-08-25 50 views
1

我需要的方式來編碼的字符串爲Mime/Base64編碼在Delphi 7和PHP默/ Base 64編碼

這兩個編碼器必須是相容的:)

+0

誰將要編碼,誰將解碼? – 2010-08-25 08:36:04

回答

1

自Delphi 6以來,單元EncdDecd已被包含;下面是它包含的Mime兼容base64函數。

這個cached post from FlexVNoriginal post並不總是在線)解釋瞭如何使用EncdDecd單元來完成PHP和Delphi之間的base64事情。

unit EncdDecd; 

interface 

uses Classes, SysUtils; 

procedure EncodeStream(Input, Output: TStream); 
procedure DecodeStream(Input, Output: TStream); 
function EncodeString(const Input: string): string; 
function DecodeString(const Input: string): string; 

function DecodeBase64(const Input: AnsiString): TBytes; 
function EncodeBase64(const Input: Pointer; Size: Integer): AnsiString;