Cannot open file with manual plist encoding

I have an Excel file containing about 60 rows and 4 columns to convert to test.plist file. I wrote the csv2xml parser and created plist, but Xcode refuses to recognize it when I added test.plist to the project. Double-clicking on a file inside Xcode shows this error:

The document test.plist cannot be opened.  Conversion of string failed.  The string is empty.

I even used the Xcode property editor to create a comparable plist with a single record and split them, and I really don't see any problem.

Here is my plist. Tab stops ("\ t"), eol - "\ n". Please help me! I am stuck.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="1.0">
<array>
    <dict>
            <key>Field1</key>
            <string>3/20/10</string>
            <key>Field2</key>
            <string>ValueOfField2</string>
            <key>Field3</key>
            <string>ABC 40</string>
            <key>Field4</key>
            <string>&quot;On March 20 1:30 UTC, this will happen.  &quot;</string>
    </dict>
</array>
</plist>
+3
source share
3 answers

You can run plutil -lint myTestFile.plistto find out what errors are.

+6

plist Apple? , .

0

.

I fixed the problem - it turns out that when I copied and pasted some text from a Word document to create this Excel file, there were strange characters. Replacing them globally in the csv source file and then re-creating the xml, the problem is resolved.

Really appreciate all the help!

0
source

Source: https://habr.com/ru/post/1727660/


All Articles