Smit
Smit

Reputation: 395

format NSString to hold ascii value rather than unicode characters

I have a string absoluteUrl of any file and some plist file entries for the directory files (where one entry is for the absoluteUrl).

NSString *absoluteURL = @"/Users/macbookpro/abc - 20404_1_C-not-001-Akustiske forhold i glassgården.pdf";

NSDictionary *plistData has some dictionary value:

"/Users/macbookpro/abc - 20404_1_C-not-001-Akustiske forhold i glassg\U00e5rden - Drammensveien 134.pdf" = { };

"/Users/macbookpro/abc - 24563_1_A-auronfred.pdf" = { };

...

here when i try to get one dictionary from plistData: NSMutableDictionary *filePlistData = [plistData valueForKey:absoluteURL];

Now when i try to look up plist file the "å" is in UTF16 format but when i tried to print plistData "å" is converted to "\U00e5" which is the main reason why i get filePlistData = "nil".

Now what should i try to get rid from this??

thank you all of you for ur tremendous support.

Upvotes: 1

Views: 119

Answers (1)

Smit
Smit

Reputation: 395

I have worked a lot and got a solution to use :

precomposedStringWithCanonicalMapping

to read plist data

Upvotes: 1

Related Questions