EDIT 2:
, , . . , % 25. . - . , ( stringByAddingPercentEscapesUsingEncoding:). " ". " % اختبار%" ( ), (, ?). , .
EDIT:
, ( ) URL-. URL- , . , , . "اختبار" URL-. (اختبار , IDN).
URL this is a %25<arabic>%25 string:
this%20is%20a%20%2525%D8%A7%D8%AE%D8%AA%D8%A8%D8%A7%D8%B1%2525%20string
, :
this is a %25اختبار%25 string
, ( , ). (, ):
this - this (ALPHA)
%20 - <space> (encoded)
is - is (ALPHA)
%20 - <space> (encoded)
a - a (ALPHA)
%20 - <space> (encoded)
%25 - % (encoded)
25 - 25 (DIGIT)
%D8%A7 - ا (encoded)
%D8%AE - خ (encoded)
%D8%AA - ت (encoded)
%D8%A8 - ب (encoded)
%D8%A7 - ا (encoded)
%D8%B1 - ر (encoded)
%25 - % (encoded)
25 - 25 (DIGIT)
%20 - <space> (encoded)
string - string (ALPHA)
Unicode BIDI , ; , . , . (, LRO), URL-, - .
, , , , URL-, ? URL-, URL-, ( , , , ). , . , BIDI.
, ( , URL-, ). , . , , URL-, UIPasteboard copy:, . , . ( , Safari "stackoverflow.com" , , "/fooobar.com/..." .
, .
, stringByReplacingOccuranceOfString: . , . characterAtIndex:, , :
% 2 5 ا ...
, " ". , , "% 25" . , .
. -, Unicode 6.3 tr9-29 . , . , . Unicode 6.3 iOS OS X, , ( ) "".
FSI (FIRST STRONG ISOLATE U + 2068) PDI (POP DIRECTIONAL ISOLATE U + 2069). RLI (RIGHT-TO-LEFT ISOLATE), . FSI " , ".
, :
NSString *test = @"this is a %25\u2068test\u2069%25 string";
NSString *arabic = @"اختبار";
NSString *result = [test stringByReplacingOccurrencesOfString:@"test" withString:arabic];
, , ( , FSI PDI). , :
NSString * const FSI = @"\u2068";
NSString * const PDI = @"\u2069";
NSString *test = @"this is %25test%25 string";
NSString *arabic = @"اختبار";
NSString *replaceString = [@[FSI, arabic, PDI] componentsJoinedByString:@""];
NSString *result = [test stringByReplacingOccurrencesOfString:@"test" withString:replaceString];
, " " . UILabel, , , -, Core Text. NSLog "placeholder":

. UIWebView, .
, . . . LRM RLM . , LRM ( ), . , , , ( ).
NSString * const LRM = @"\u200e";
NSString *test = @"this is a %25test%25 string";
NSString *replaceString = [@[LRM, arabic, LRM] componentsJoinedByString:@""];
NSString *result = [test stringByReplacingOccurrencesOfString:@"test" withString:replaceString];
BTW, . , . .
- . " , ", "" Unicode. , . , (<RLO>elgoog<PDF>.com google.com ). .
LRO/PDF, . RLO/PDF, -. , , :
NSString * const LRO = @"\u202d";
NSString * const RLO = @"\u202e";
NSString * const PDF = @"\u202c";
NSString *test = [@[LRO, @"this is a %25test%25 string", PDF] componentsJoinedByString:@""];
NSString *arabic = @"اختبار";
NSString *replaceString = [@[RLO, arabic, PDF] componentsJoinedByString:@""];
NSString *result = [test stringByReplacingOccurrencesOfString:@"test" withString:replaceString];
, Explicit Directional Embedding, (, RLE RLO , LRO).
, , . . TR9 . , . Cal Henderson excellent (BIDI) .