• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
stringWithCString vs stringWithUTF8String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stringWithCString vs stringWithUTF8String


  • Subject: stringWithCString vs stringWithUTF8String
  • From: Brian Redman <email@hidden>
  • Date: Mon, 4 Nov 2002 13:09:32 -0500

I've got some email text I read from a pop server. According to the header it's:

Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

When I create an NSString from the char* text using stringWithUTF8String I get nil. If I use stringWithCString it works. I get an NSString containing my text.
If I want to avoid stringWithCstring what method(s) should I be using to create the NSString from this text? I read through the NSString encoding material but I really don't get it.
Up until now replacing all my CStrings with UTF8Strings has worked transparently.

By the way the string is an email containing an ASP report saved as ascii text.

Thanks,

brian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: stringWithCString vs stringWithUTF8String
      • From: "Clark S. Cox III" <email@hidden>
    • Re: stringWithCString vs stringWithUTF8String
      • From: Jim Correia <email@hidden>
    • Re: stringWithCString vs stringWithUTF8String
      • From: Chris Ridd <email@hidden>
  • Prev by Date: Re: metallized interface
  • Next by Date: Re: stringWithCString vs stringWithUTF8String
  • Previous by thread: (no subject)
  • Next by thread: Re: stringWithCString vs stringWithUTF8String
  • Index(es):
    • Date
    • Thread