views:

48

answers:

1

I am listing out data to a UITableView from a plist file where I have a two dimensional array/dictionary:

<?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"&gt;
<plist version="1.0">
<array>
    <dict>
        <key>ID</key>
        <integer>1</integer>
        <key>Title</key>
        <string>Middelthunsgate</string>
        <key>Description</key>
        <string>Vis-a-vis nr 21, retning Kirkeveien</string>
    </dict>
</array>
</plist>

(In case you're wondering, this is in Norwegian.) This works fine, until I start using some special Norwegian characters like æøå etc. The app builds without errors, but it crashes. I found out it was because I used the characters ø and é as the string for the Title key. When I removed that dictionary, it ran just fine again.

What can I do to make sure it reads fine, even with i18n characters?

+1  A: 

Make sure the plist is saved as UTF-8 encoding, instead of MacRoman.

Use the "Property List Editor" (comes with the iPhone SDK) so that you don't need to care about encodings.

KennyTM
The file is actually UTF-8. It was made with the Property List Editor as well. Can it be the code I use to populate the UITableView that creates this error?
rebellion
@rebellion: What is the crash message?
KennyTM
That's the problem, the console won't log anything. The app is just quitting on me.
rebellion
It actually seems that the Norwegian characters might not be the problem. Adding a third dictionary entry in the `plist` file also causes the app to crash..
rebellion