• 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
Unicode and various NSString questions ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unicode and various NSString questions ...


  • Subject: Unicode and various NSString questions ...
  • From: J Nozzi <email@hidden>
  • Date: Sun, 1 Feb 2004 20:30:45 -0500

Hello, list:

I'm writing a routine to import text from files that were generated by a REALbasic app. I have a few questions about NSString and Unicode and am hesitant to admit my complete ignorance of the subject. Regardless, here goes! ;-)

1. I'm assuming UTF-8 (as in stringWithUTF8String:) is Unicode. Is this true?

2. If I use NSString's "initWithContentsOfFile:", I assume whatever encoding the text file was created with is what you get into the NSString. Is this correct?

3. If I create an NSString based on the contents of an NSTextView, what encoding IS it?

4. Assuming the text file's contents were anything but Unicode, how would I convert it?

... the reason I ask is because I'm getting odd behavior (unpredictable to the point that I can't yet even put an explanation into words) when trying to work with these files after import until they're opened and re-saved with an NSTextView. It took me a few days just to figure out just what the problem *was*, let alone how to solve it. Any help would be greatly appreciated.

- J
_______________________________________________
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: Unicode and various NSString questions ...
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: Manually installing an autorelease pool for NSEvents?
  • Next by Date: Re: Row dragging ...
  • Previous by thread: Re: Manually installing an autorelease pool for NSEvents?
  • Next by thread: Re: Unicode and various NSString questions ...
  • Index(es):
    • Date
    • Thread