• 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
Re: cString vs UTF8String (memory question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cString vs UTF8String (memory question)


  • Subject: Re: cString vs UTF8String (memory question)
  • From: Andreas Mayer <email@hidden>
  • Date: Fri, 12 Dec 2003 22:42:13 +0100

Am 12.12.2003 um 21:45 schrieb John Timmer:

in downloading some web
page info, using UTF8String would mostly work, but occasionally return nil,

Well, if some data isn't in UTF8 you should not try to convert it to an UTF8 string.

I wound up having to use
initWithData: encoding: and use NSISOLatin1StringEncoding in order to make
sure that something was consistently generated.

While this will not break, you might simply get a wrong representation if the source is not in Latin 1.

If alle bytes are below 128 most encodings (including UTF8) will give the same results.


bye. Andreas.
_______________________________________________
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.

References: 
 >Re: cString vs UTF8String (memory question) (From: John Timmer <email@hidden>)

  • Prev by Date: Re: ZeroLink FAQ (was Re: XCode or code problems?)
  • Next by Date: New NSMovie deallocation behavior in Panther
  • Previous by thread: Re: cString vs UTF8String (memory question)
  • Next by thread: RE: Communication between a NSTabView and an NSTextField...now NSPrefPane
  • Index(es):
    • Date
    • Thread