mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 00:05:53 +01:00
Added parameter to inform string encoding.
This commit is contained in:
parent
4b41c65721
commit
15aa842bf2
@ -513,7 +513,7 @@ function B64Encode(const aValue: string): string; overload;
|
|||||||
function B64Encode(const aValue: TBytes): string; overload;
|
function B64Encode(const aValue: TBytes): string; overload;
|
||||||
function B64Decode(const aValue: string): string;
|
function B64Decode(const aValue: string): string;
|
||||||
|
|
||||||
function URLSafeB64encode(const Value: string; IncludePadding: Boolean): string; overload;
|
function URLSafeB64encode(const Value: string; IncludePadding: Boolean; AByteEncoding: IIdTextEncoding = nil): string; overload;
|
||||||
function URLSafeB64encode(const Value: TBytes; IncludePadding: Boolean): string; overload;
|
function URLSafeB64encode(const Value: TBytes; IncludePadding: Boolean): string; overload;
|
||||||
function URLSafeB64Decode(const Value: string): string;
|
function URLSafeB64Decode(const Value: string): string;
|
||||||
|
|
||||||
@ -979,12 +979,12 @@ begin
|
|||||||
FFillChar := '='; { Do not Localize }
|
FFillChar := '='; { Do not Localize }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function URLSafeB64encode(const Value: string; IncludePadding: Boolean): string; overload;
|
function URLSafeB64encode(const Value: string; IncludePadding: Boolean; AByteEncoding: IIdTextEncoding = nil): string; overload;
|
||||||
begin
|
begin
|
||||||
if IncludePadding then
|
if IncludePadding then
|
||||||
Result := TURLSafeEncode.EncodeString(Value)
|
Result := TURLSafeEncode.EncodeString(Value, AByteEncoding)
|
||||||
else
|
else
|
||||||
Result := TURLSafeEncode.EncodeString(Value).Replace('=', '', [rfReplaceAll]);
|
Result := TURLSafeEncode.EncodeString(Value, AByteEncoding).Replace('=', '', [rfReplaceAll]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user