This is my code:
var signature_parameters = new SortedDictionary<string, string>()
{
{ "client_id", client_id },
{ "timestamp", timestamp },
};
var signature_base_string = string.Join("&", signature_parameters.Select(p => string.Format("{0}={1}", p.Key, p.Value)));
Response.Write(signature_base_string);
which prints client_id=2446782×tamp=1291723521
What is ×?
Your join is putting the text × into the string which is being encoded into x because × is a html named special character
try this,
var signature_base_string = string.Join("&", signature_parameters.Select(p => string.Format("{0}={1}", p.Key, p.Value)));
Response.Write(signature_base_string);
Or you can use HttpUtility.HtmlEncode to convert string to HTML- encoded string.
var signature_base_string = string.Join("&", signature_parameters.Select(p => string.Format("{0}={1}", p.Key, p.Value)));
Response.Write(HttpUtility.HtmlEncode(signature_base_string));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With