Convert Arabic NSString to Decode string in IOS [duplicate] - ios

This question already has answers here:
How do I URL encode a string
(24 answers)
Closed 8 years ago.
How to convert the Arabic text like http://www.someurl.com/Category/صفوف to http://www.someurl.com/Category/%D8%B5%D9%81%D9%88%D9%81 , Like when we paste the http://www.someurl.com/Category/صفوف to any browser it will show http://www.someurl.com/Category/%D8%B5%D9%81%D9%88%D9%81.

many solutions available
try this page first solution and solution no (17) they've what you're looking 4
How do I URL encode a string

Related

Localization.strings: The data couldn’t be read because it isn’t in the correct format [duplicate]

This question already has answers here:
Localization in Swift 2
(3 answers)
Closed 5 years ago.
The data couldn’t be read because it isn’t in the correct format. The text in .string file. Please help me for it
abc = "abc"
xyz = "xyz"
You have to set a semicolon after each row, that´s why you´re getting that error:
Like this:
abc = "abc";
xyz = "xyz";

How to get iOS APP archive date using Swift [duplicate]

This question already has answers here:
Get build date and time in Swift
(6 answers)
Closed 5 years ago.
I have a requirement in my application that, i need to show .ipa file creation date using swift.
Can anybody tell me how to do that.
Thanks in advance.
You can get the url of your app using Bundle property executableURL and use url method resourceValues to get the bundle creation date:
if let executableURL = Bundle.main.executableURL,
let creation = (try? executableURL.resourceValues(forKeys: [.creationDateKey]))?.creationDate {
print(creation)
}

How to get String from a NSTaggedPointerString? [duplicate]

This question already has answers here:
convert NSTaggedPointerString to NSString
(5 answers)
Closed 6 years ago.
It's about a Get network request, for more information please see this pic.
I want to get the argument "pilotCode", but its value is "0xa00006e....", I want to get its real value which is "admin", please tell me what should I do?
Thank you very much.
I solved this problem just now.
just add this code:
"NSString *realStr = [NSString stringWithString:pilotCode];"

String Shown as Unicode - Swift [duplicate]

This question already has answers here:
Saving Hebrew text to NSUserDefaults return strange encoding
(3 answers)
Closed 7 years ago.
When I print a String array to the log most of the Strings show up like they're suppose to, but sometimes the show like this:
\U200e\U05d3\U05d5\U05e8\U05d9\U05ea \U05dc\U05d5\U05d9\U200e
What is causing this problem?
When you log an array with NSLog, or when you log an NSArray with print, you are relying on Cocoa's logging. It's very old so it represents a non-ASCII string by showing its codepoints.
If you don't like that, log with Swift's print and make sure you are logging a Swift Array, not an NSArray.
let s = "\u{200e}\u{05d3}\u{05d5}\u{05e8}\u{05d9}\u{05ea}"
NSLog("%#",[s]) // Cocoa is logging
print([s] as NSArray) // Cocoa is logging
print([s]) // Swift is logging

Correct URL encoding in Cocoa (ObjC) [duplicate]

This question already has answers here:
How do I URL encode a string
(24 answers)
Closed 9 years ago.
I am trying to URL encode an NSString but I can't seem to find the proper way (I'm new to Obj C). I have been searching around but can't find a decent answer. So:
What is the correct, and modern, way to encode an NSString like a URL?
Thanks in advance.
Encoding to UTF-8:
NSString *strUTF8 = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

Resources