Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Change of MGTwitterEngine.m - sendUpdate: #97

Open
wants to merge 1 commit into from

1 participant

@semnil

Corresponding to escape processing of Twitter.

@semnil semnil Update MGTwitterEngine.m - sendUpdate:
Corresponding to escape processing of Twitter.
52ca09e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 23, 2011
  1. @semnil

    Update MGTwitterEngine.m - sendUpdate:

    semnil authored
    Corresponding to escape processing of Twitter.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 MGTwitterEngine.m
View
6 MGTwitterEngine.m
@@ -1262,8 +1262,12 @@ - (NSString *)sendUpdate:(NSString *)status inReplyTo:(MGTwitterEngineID)updateI
NSString *path = [NSString stringWithFormat:@"statuses/update.%@", API_FORMAT];
+ // Compatible with Twitter escaping
+ NSString *unescapedStatus = [status stringByReplacingOccurrencesOfString:@"&lt;" withString:@"<"];
+ unescapedStatus = [unescapedStatus stringByReplacingOccurrencesOfString:@"&gt;" withString:@">"];
+
// Convert the status to Unicode Normalized Form C to conform to Twitter's character counting requirement. See http://apiwiki.twitter.com/Counting-Characters .
- NSString *trimmedText = [status precomposedStringWithCanonicalMapping];
+ NSString *trimmedText = [unescapedStatus precomposedStringWithCanonicalMapping];
if ([trimmedText length] > MAX_MESSAGE_LENGTH) {
trimmedText = [trimmedText substringToIndex:MAX_MESSAGE_LENGTH];
}
Something went wrong with that request. Please try again.