Skip to content

URL encoding is wrong #86

Merged
merged 4 commits into from Jan 1, 2012
View
10 OAuthConsumeriPhoneLib/OAuthConsumerSrc/OARequestParameter.m
@@ -52,14 +52,20 @@ - (void)dealloc
[super dealloc];
}
+-(NSString *)urlEncode:(NSString*)stringThatNeedsEncoding
+{
+ NSString *result = (NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)stringThatNeedsEncoding, NULL, CFSTR("!*'\"();:@&=+$,/?#[]%<>{} "), kCFStringEncodingUTF8);
+ return [result autorelease];
+}
+
- (NSString *)URLEncodedName
{
- return [self.name stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
+ return [self urlEncode:self.name]; //[self.name stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
}
- (NSString *)URLEncodedValue
{
- return [self.value stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
+ return [self urlEncode:self.value]; //[self.value stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
}
- (NSString *)URLEncodedNameValuePair
View
BIN Twitter+OAuth/Libraries & Headers/libOAuth.a
Binary file not shown.
Something went wrong with that request. Please try again.