php - NSMutableDictionary not initializing if certain characters included -
i'm trying create nsmutabledictionary , populate forum posts queried website. super-simple code, nothing but...
_postbodies = [[nsmutabledictionary alloc] initwithcontentsofurl:[nsurl urlwithstring:urlbodiessource]]; ...pulling php/mysql-generated plist file, , works great. thing is, if of posts include characters, such non-english letters or html symbols , like, whole thing fails initialize altogether. i've tracked in debugger line-by-line, , can literally watch work 34 posts (or whatever) in source file, add 35th post weird characters plist , whole thing fails initialize.
is there way around this? method stripping out or escaping characters problematic nsmutabledictionary? or tripping plist file perhaps, , dictionary working fine?
for example, check out this plist source file. it's 3 posts long, , last 1 problem. exclude post, whole thing works; include , nsmutabledictionary fails populate @ all. seems pretty normal, except has tabs , o's circumflexes on them.
<key>2</key> <string>wow, squattingb. know i'm melodramatic, what's you? lol. yeah, it's shame cool people congregated here watch codex, have series end , leave dumbstruck do. (it good, nothing else has same appeal) forum remain cool has been point when creators out of college. maybe can see whether have awesome news of next series , forum or if boot hbo. lol.but forum?dictionary forum |?fôr?m| noun ( pl. forums ) 1 place, meeting, or medium ideas , views on particular issue can exchanged : forum consumers exchange views on medical research. 2 court or tribunal. 3 ( pl. fora |?fôr?|) (in ancient roman city) public square or marketplace used judicial , other business. origin late middle english (sense 3) : latin, literally ‘what out of doors,’ denoting enclosure surrounding house; related fores ‘(outside) door.’ sense 1 dates mid 18th cent.that's thought. people make great, yes? , i'm sure patrons aren't leaving anytime soon, we're in pretty standing become of forum. now, anyway.</string> has experienced before, or can offer advice? i'm getting started simpler solutions appreciated, i'd love insight can offer!
are checking plist text encoding? remember ios programming done in utf-8.
i assume (as question marked php tag), url retrieving works php. did try encoding text using utf8_encode()?
another way using json. json_encode() in php automatically translates weird characters utf-8 hex-representation (\x{number}). also, try using htmlspecialchars().
good luck!
Comments
Post a Comment