Skip to content

Commit

Permalink
Changed character counting in sendUpdate: to use Unicode Normalized F…
Browse files Browse the repository at this point in the history
…orm C canonical mapping.
  • Loading branch information
luciuskwok authored and stevestreza committed May 1, 2010
1 parent 8e9451a commit c6b5911
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MGTwitterEngine.m
Expand Up @@ -1177,7 +1177,8 @@ - (NSString *)sendUpdate:(NSString *)status inReplyTo:(MGTwitterEngineID)updateI

NSString *path = [NSString stringWithFormat:@"statuses/update.%@", API_FORMAT];

NSString *trimmedText = status;
// 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];
if ([trimmedText length] > MAX_MESSAGE_LENGTH) {
trimmedText = [trimmedText substringToIndex:MAX_MESSAGE_LENGTH];
}
Expand Down

0 comments on commit c6b5911

Please sign in to comment.