Straight out of OAuthBase and Shannon Whitley's work:
protected string UrlEncode(string value)
{
StringBuilder result = new StringBuilder();
if (!string.IsNullOrEmpty(value))
{
foreach (char symbol in value)
{
if (unreservedChars.IndexOf(symbol) != -1)
{
result.Append(symbol);
}
else
{
result.Append('%' +
String.Format(CultureInfo.InvariantCulture, "{0:X2}", (int)symbol));
}
}
}
return result.ToString();
}
∞ Andy Badera
∞ This email is: [ ] bloggable [x] ask first [ ] private
∞ Google me: http://www.google.com/search?q=(andrew+badera)+OR+(andy+badera)
On Thu, Aug 13, 2009 at 3:47 PM, catcalls<[email protected]> wrote:
>
> This is really bugging me now!
>
> So far I've tried the following;
>
> post_data = "status="Hi carla""
>
> or
>
> post_data="status='hi carla'"
>
> or
>
> post_data="status=Hi%20Carla"
>
> Nothing works!
>
> What is required to post spaces to twitter?
>