Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (21 sloc) 0.732 kb
//
// ASINSStringAdditions.m
// asi-http-request
//
// Created by Ben Copsey on 12/09/2008.
// Copyright 2008 All-Seeing Interactive. All rights reserved.
//
#import "ASINSStringAdditions.h"
@implementation NSString (CookieValueEncodingAdditions)
- (NSString *)decodedCookieValue
{
NSMutableString *s = [NSMutableString stringWithString:[self stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
//Also swap plus signs for spaces
[s replaceOccurrencesOfString:@"+" withString:@" " options:NSLiteralSearch range:NSMakeRange(0, [s length])];
return [NSString stringWithString:s];
}
- (NSString *)encodedCookieValue
{
return [self stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
@end
Jump to Line
Something went wrong with that request. Please try again.