Stack Exchange
Helping to understand the code
I am rewriting iPad application on Windows 8.
in xcode there is:
- (NSString *)urlEncodeString: (NSString *) string{
return (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)string,NULL,CFSTR("!*'();:@&=+$,/?%#[]"),kCFStringEncodingUTF8));
}

Am i correct that this part of code replaces those !*'();:@&=+$,/?%#[] symbols with ASCII codes?
And if somebody knows C# am i doing it right:
string data = Uri.EscapeDataString(myString);



Am I correct that this part of code replaces the !*'();:@&=+$,/?%#[] symbols with ASCII codes?

Not exactly: parameter 4 of CFURLCreateStringByAddingPercentEscapes specifies the characters to be escaped in addition to the ones that are not legal URL characters based on RFC 3986. Since the string passes characters that are not subject to percent-encoding according to RFC 3986, the result is going to be different from what you get back by escaping the URI in C#.

And if somebody knows C# am I doing it right?

The Uri.EscapeUriString method looks like a better match, although it would leave some of the legal RFC 3986 characters unencoded.
