I was looking for a equivalent function to PHP RawURLEncode (and Decode) in cpp builder (or delphi).
I use the following string to test: _%_&_+_=_ _"_'_a_b_c_d_e_f_g_h_
(I wish to encode only var values, not a entire URL)
The rawurlencode returns: _%25_%26_%2B_%3D_%20_%22_%27_a_b_c_d_e_f_g_h_
I have tried without success:
_%25_&_+_=_%20_%22_'_a_b_c_d_e_f_g_h_
_%25_&_%2B_=_%20_%22_'_a_b_c_d_e_f_g_h_
_%_& amp;_+_=_ _& quot;_'_a_b_c_d_e_f_g_h_
(space added after "&")PHP's RawURLEncode
is an implementation of RFC 3986. My websearch for that yields this Delphi unit which claims to implement RFC 3986.
I tested it on your input:
{$APPTYPE CONSOLE}
uses
System.SysUtils,
UURIEncode in 'UURIEncode.pas';
begin
Writeln(URIEncode('_%_&_+_=_ _"_''_a_b_c_d_e_f_g_h_'));
Readln;
end.
The output was:
_%25_%26_%2B_%3D_%20_%22_%27_a_b_c_d_e_f_g_h_
The key to my successful websearch was found in the PHP documentation for RawURLEncode
where is states:
URL-encode according to RFC 3986