• 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: What is this invisible character?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is this invisible character?


  • Subject: Re: What is this invisible character?
  • From: Deborah Goldsmith <email@hidden>
  • Date: Mon, 24 Mar 2008 17:59:54 -0700

UTF-8 should only be used for text files that are expected to be passed to legacy software (including Internet applications). For text that is not in a plain text file (or HTML or other MIME subtype of TEXT), UTF-16 is preferred.

NSString will interpret the BOM for you if you indicate the encoding is "external".

Deborah Goldsmith
Apple Inc.
email@hidden

On Mar 19, 2008, at 11:34 AM, Jens Alfke wrote:

On 19 Mar '08, at 10:04 AM, J. Todd Slack wrote:

How do I write an ASCII 254 and ASCII 255 at the beginning of the NSString
that I am putting in the file I want to be read back in at a later date? '

Those wouldn't go into the NSString; they're the byte-order-mark that prefixes the UTF-16 data, not part of the character data itself.


I really recommend you write out the string in UTF-8 instead, as I suggested yesterday (with example code). UTF-8 is the most common modern encoding for text, because (a) it's a superset of ascii, and (b) for Roman alphabets it's up to twice as compact as UTF-16.

—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: What is this invisible character? (From: "J. Todd Slack" <email@hidden>)
 >Re: What is this invisible character? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Communications between multiple NIB's
  • Next by Date: Source list using bindings?
  • Previous by thread: Re: What is this invisible character?
  • Next by thread: Re: What is this invisible character?
  • Index(es):
    • Date
    • Thread