stringWithContentsOfURL bug?
stringWithContentsOfURL bug?
- Subject: stringWithContentsOfURL bug?
- From: Benjámin Salánki <email@hidden>
- Date: Thu, 6 Jan 2005 01:19:47 +0100
Hi,
I am not sure if this is a bug, but I'm really getting tired of
experimenting here, maybe some of you can point me towards the obvious
direction :D
Here's what I'm trying to do:
I have some data on a webserver in MySQL databases, so I wrote a PHP
script that loads the relevant data, and creates a long string that
formats the data in good old plist format. Then I print this out.
I try to access the string using the stringWithContentsOfURL: method
(which I have used in quite some projects already, so I already know
this should work). When my string is short, maybe 5 lines when
displayed in Safari, the string gets loaded fine.
Like this:
<dict><key>Category</key><array><dict><key>category_id</key><string>1</
string><key>category_name</key><string>Finder</string></
dict><dict><key>category_id</key><string>2</string><key>category_name</
key><string>Mail</string></dict><dict><key>category_id</key><string>3</
string><key>category_name</key><string>Safari</string></dict></array></
dict>
But when I add a longer string, suddenly I get garbled data, with
NSLog() only outputting the
ã
character. The strange thing is, that wether I use NSString's, NSData's
or whatever else's methods it won't work on any of them. But Safari
displays it right, and if i copy it from safari and save the text in
TextEdit and name it something.plist it opens up just well in the
Property List Editor.
Any ideas what might be causing this or do you have a better way of
getting data from a MySQL table on the web to a local plist file?
thx,
Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden