Should HtmlEncode be used when updating tweeter status with Tweetsharp?
I am using tweetsharp to send tweets.
var response = _twitter.AuthenticateWith(item.TwitterToken, item.TwitterSecret)
.Statuses().Update(HttpUtility.HtmlEncode(item.Tweet)).AsXml().Request().Response;
As you may have noticed above I have an HtmlEncoding message, this can result in a message over 140 characters long? Is encoding a message in this way necessary? Can tweetsharp or twitter send messages first without encoding?
a source to share
From here :
The Twitter API supports UTF-8 encoding. Note that the angle brackets ("<" and ">") are entity-encoding to prevent cross-site scripting attacks for embedded web applications consumers of JSON API products. the resulting encoded entities count to the 140 character limit. when the request is XML, the response is UTF-8 encoded. Characters and characters outside the standard ASCII range can be translated to HTML objects .
This tells me that you should really make sure that your output is encoded (not necessarily HTML encoded) in UTF-8. Have you tried to encode UTF-8 and then send and then view the output of the "special" characters?
a source to share