Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3402278
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:07:06+00:00 2026-05-18T05:07:06+00:00

this is a silly n00b question but i just don’t get it to work.

  • 0

this is a silly n00b question but i just don’t get it to work. I do believe that i need to convert to NSString and leverage “stringWithUTF8String:” but do not understand exactly how to implement it in this code so i get the right output in the NSLog. I have been looking around but it still do not work. The plist is correct.

My output is:

2010-11-07 21:43:00.419 plist_test[2984:207] Förbered och skriv  
2010-11-07 21:43:00.425 plist_test[2984:207] KLART  
2010-11-07 21:43:00.425 plist_test[2984:207] LÄS IN PLIST  
2010-11-07 21:43:00.427 plist_test[2984:207] array2: (  
    ETT,    
    "TV\U00c5",  ========Here is the problem, should be "TVÅ"    
    TRE,  
    FYRA  
)

Here is the code i am using.

- (void)viewDidLoad {

NSLog(@"Förbered och skriv");

NSMutableArray *array = [[NSMutableArray alloc] init];  
[array addObject:@"ETT"];  
[array addObject:@"TVÅ"];  
[array addObject:@"TRE"];  
[array addObject:@"FYRA"];  

[array writeToFile:@"/Users/PeterK/Desktop/plisttest.plist" atomically: TRUE];


NSLog(@"KLART");


NSLog(@"LÄS IN PLIST");

NSMutableArray *array2 = [[NSMutableArray alloc] init];

array2 = [NSMutableArray arrayWithContentsOfFile:@"/Users/PeterK/Desktop/plisttest.plist"];

NSLog(@"array2: %@", array2); ====here is the output


[super viewDidLoad];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:07:06+00:00Added an answer on May 18, 2026 at 5:07 am

    Objective-C String Literals are not strictly 7-bit ASCII, as your example has shown. However, you should avoid using anything but 7-bit ASCII for consistency and compatibility.

    The follow work for simply loading strings using Unicode safely.

    + (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error;
    + (id)stringWithContentsOfFile:(NSString *)path encoding:(NSStringEncoding)enc error:(NSError **)error;
    

    Localized String stuff is for multi-lingual interface stuff. Separating the text shown from the buttons shown, and such.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe this is a silly question, but I'm working on a project that wants
This is a bit of a silly question but I don't know how to
Sorry for this silly question, but is there any way to restrict using directives
This is a silly question but How do I add an App_Data folder to
This is probably silly but I don't have enough Elisp knowledge to understand what
This seems silly, but I don't understand how Django Templates access nested data in
A very basic conceptual doubt. Please don't hate me for this silly question If
I'm afraid asking this silly question but google looks like has no answer for
this a silly question no doubt but I am a beginner and could not
This may be silly, but it's been nagging the back of my brain for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.