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

  • Home
  • SEARCH
  • 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 987861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:33:00+00:00 2026-05-16T05:33:00+00:00

This one is weird. Hopefully I will ask the right question: I’m using an

  • 0

This one is weird. Hopefully I will ask the right question:

I’m using an md5 method to create a checksum value which I then write to a file. Then afterwards I read the file using this:

NSString * id_From_File = [[NSString alloc]
                                  initWithContentsOfFile:path_to_ID
                                  encoding:NSUTF8StringEncoding
                                  error:&error];

The result gets placed in a NSString which when I print gives me very strange behaviour. For example when I use this to print,

id_with_date = [NSString stringWithFormat:@"  %@  %@", dateString, id_From_File];

it will print both strings if dateString is placed in the first parameter and id_From_File in the second. If I switch them around (which I need to do) only id_From_File shows.

Edit 1: Example of the switch:

id_with_date = [NSString stringWithFormat:@" %@  %@", id_From_File, dateString];

I strongly believe this has something to do with the encoding of the id_From_File string.

Any knowledge!?

Thanks,

  • 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-16T05:33:01+00:00Added an answer on May 16, 2026 at 5:33 am

    NSString should actually be capable of recognizing null characters as the file ending. Did you try to use a different method to load the string. I’d go for this one instead:

    - (id)initWithContentsOfFile:(NSString *)path usedEncoding:(NSStringEncoding *)enc error:(NSError **)error
    

    This method automatically detects the file’s encoding instead of decoding it with a fixed one.

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

Sidebar

Related Questions

This one will take some explaining. What I've done is create a specific custom
This is a weird one, but hopefully someone can give me an idea here.
This one is weird, I have a page that consists of a html table
This is a bit of a weird one, and I could well be coding
Ok, this is a weird one. The junk data isn't random either, it appears
Pointless Dribble Okay This is another weird one from me, i want to thank
Ok, this is a really weird one. I have an MPI program, where each
This one has me kind of stumped. I want to make the first word
This one has been bugging me for a while now. Is there a way
This one has me scratching my head. I'm running Subversion 1.3.1 (r19032) on Ubuntu.

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.