I had this problem a while back after switching to oAuth and ended up 
writing my own encoding function which works fine.
 
Here are the essential snippets!
 
            string oAuthUnreservedChars = 
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
            StringBuilder sb = new StringBuilder();
            Encoding uTF8Encoding = Encoding.UTF8;
 
                   foreach (char thisChar in inStr)
                    {
                        if (oAuthUnreservedChars.IndexOf(thisChar) != -1)
                        {
                            sb.Append(thisChar);
                        }
                        else
                        {
                            byte[] bytes = 
uTF8Encoding.GetBytes(thisChar.ToString());
                            foreach (byte b in bytes)
                            {
                                sb.Append('%' + String.Format("{0:X2}", b));
                            }
                        }
                    }
Hope that works for you!
 
Regards
 
Paul

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to