In particular, I'm editing the AutoCompletion.plist file for CSSEdit (if that even matters).
My question is, are there any characters withing the STRING elements that need to be escaped? spaces? quotes?
EDIT: Just to be clear, I'm not using CSSEdit to edit the file - rather the file is part of the CSSEdit package. I'm using TextMate to edit the file (although "Property List Editor.app" is another option) and it is in XML format. Here's a snippet from the AutoCompletion.plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>font-family</key>
<array>
<string>Arial</string>
<string>Helvetica</string>
<string>Georgia</string>
<string>serif</string>
<string>sans-serif</string>
<string>cursive</string>
etc...
I'd like to add STRINGs with spaces and single quotes such as:
<string>Georgia, Times, 'Times New Roman', serif</string>
But CSSEdit goes haywire when I edit the file as such
If you're editing an XML plist using a text editor of some sort, you'll need to escape characters just like in any XML. The basic characters to watch out for are:
< (less than), escaped as <
> (greater than), escaped as >
& (ampersand), escaped as &
' (apostrophe), escaped as '
" (quote mark), escaped as "
So in your example, you would want
<string>Georgia, Times, 'Times New Roman', serif</string>
You can also use a tool such as Apple's Property List Editor, which is included with their free Xcode developer tools, or a third party product like PlistEdit Pro, both of which will take care of all the character escaping for you.
You can use plutil
to check the syntax of your plists. (Note that this won't validate whether the application will understand what you've done to its plist...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With