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 623631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:06:49+00:00 2026-05-13T19:06:49+00:00

I am trying to get the ASCII numbers I load from a file to

  • 0

I am trying to get the ASCII numbers I load from a file to convert into plain text. I’ve looked at NSASCIIStringEncoding, but when I run it it just returns what I inputted.

Here’s the code I’m using:

NSData *asciiData = [[myWords objectAtIndex:d] dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *test = [[NSString alloc] initWithData:asciiData encoding:NSASCIIStringEncoding];

Here’s an example:

ASCII string: 117 32 119 97

Expected output: u wa?

  • 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-13T19:06:49+00:00Added an answer on May 13, 2026 at 7:06 pm

    Based on the comments on your question, it sounds like your input file looks something like this:

    65 66 67
    

    That is technically eight ASCII characters: the character for the digit ‘6’, the character for the digit ‘5’, the character for a space ‘ ‘, etc.

    If you want to read those as numbers, and then output the ASCII characters they represent, you should read the file using NSString’s initWithContentsOfFile:, then use NSScanner to convert those character sequences into numbers. Then, you can output those numbers directly to a file, casting them as type char, and the resulting file will be:

    ABC
    

    You don’t actually need to declare that the numbers are ASCII when you output the file; ASCII is a system for interpreting a sequence of numbers as text. It’s an ASCII file by virtue of the fact that it happens to look OK when you open it with a text editor.

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

Sidebar

Related Questions

I'm trying to convert the following code from C# to Java, but I get
I'm trying to convert an array of characters into integers, so I can get
I am trying to get an MFC Static Text control to display an ASCII
Hey i'm trying to get text to ASCII and then store it on a
I'm trying to get the Ascii value of character but I'm a bit clueless
I am trying to read ASCII text response from a tcp open streaming socket
So i am trying get 2 div-containers which both should contain centered text (Both
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes
Trying to get a wildcard search to pick up on any text in org_name
trying to get same string on tooltip as is in the Text e.g. Text=<%#

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.