• 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: plist file and encoding format problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plist file and encoding format problem


  • Subject: Re: plist file and encoding format problem
  • From: Chris Kane <email@hidden>
  • Date: Fri, 23 Nov 2001 20:51:00 -0700

'&amp;' is needed because XML reserves '&' for special purposes. I tried:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<array>
<string>&amp;foo;</string>
</array>
</plist>

and got an array with an NSString "&foo;". You should make sure you're storing the file (if you're editing it by hand) in the encoding named in the encoding= directive in the XML banner. If there is no encoding= and the file doesn't look like Unicode with a few tests, UTF-8 will be assumed. If the encoding is an encoding unknown to NSString/CFString, UTF-8 may be assumed too. Just use either plain 7-bit ASCII, or UTF-8, if in any doubt.

Chris Kane
Cocoa Frameworks, Apple

On Monday, November 19, 2001, at 04:08 AM, Stiphane Sudre wrote:

Let's say I have a .plist file which is an <array> of <string>

I I try to put the following string: &ecirc; as the content of a <string>, what I get is &amp;ecirc; when I have a look at the file using Project Builder.

If I try to use that <string> in a .html file, what I get in OmniWeb is a weird characted (a black box with a delete sign in it)

So the question is how can I enter the &ecirc; string in a <string> and be sure that when I'm going to use it via a NSString, the cString method will give me &ecirc; ?
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: plist file and encoding format problem
      • From: Stéphane Sudre <email@hidden>
References: 
 >plist file and encoding format problem (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: Dynamically creating a class
  • Next by Date: Re: Instance methods VS. Class methods
  • Previous by thread: plist file and encoding format problem
  • Next by thread: Re: plist file and encoding format problem
  • Index(es):
    • Date
    • Thread