Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Change of MGTwitterEngine.m - sendUpdate: #97

wants to merge 1 commit into from

1 participant

Tetsuya Shinone
Tetsuya Shinone

Corresponding to escape processing of Twitter.

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

    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
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 .
- 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.