diff --git a/ChangeLog b/ChangeLog index 8f2fb9d2d..a68b1882b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-07 Wolfgang Sourdeau + + * SoObjects/SOGo/NSString+Utilities.m ([NSString + -doubleQuotedString]): new method that returns a double-quoted and + properly escaped version of the string. Since it's the same + algorithm used in jsonRepresentation, the latter is now calling + this new method. + 2009-01-07 Francis Lachapelle * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor diff --git a/SoObjects/SOGo/NSString+Utilities.h b/SoObjects/SOGo/NSString+Utilities.h index b322b78a3..8f6838fbb 100644 --- a/SoObjects/SOGo/NSString+Utilities.h +++ b/SoObjects/SOGo/NSString+Utilities.h @@ -42,6 +42,8 @@ - (NSString *) stringByDetectingURLs; +- (NSString *) doubleQuotedString; + - (NSString *) jsonRepresentation; /* bare email addresses */ diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 6adbe9e6f..6ebc222aa 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -283,7 +283,7 @@ static NSMutableCharacterSet *urlStartChars = nil; return selfCopy; } -- (NSString *) jsonRepresentation +- (NSString *) doubleQuotedString { NSMutableString *representation; @@ -300,6 +300,11 @@ static NSMutableCharacterSet *urlStartChars = nil; return [NSString stringWithFormat: @"\"%@\"", representation]; } +- (NSString *) jsonRepresentation +{ + return [self doubleQuotedString]; +} + - (NSString *) pureEMailAddress { NSString *pureAddress;