After a good while of searching over the internet, I refer to you for a quick help.
I am developing an iOS 5 application (targeted for iPhone) that consumes some JSon data. Everything worked fine, until the guys on the server side decided to implement in a JSon message an image converted in base64String.
Now, here's what happens:
i am able to download all the JSon message (below there's a sample), if i keep the JSon string and parse it with JSONlint it says the message is Ok, so i am damn sure that the message is not malformed, but when i try to parse it in JSon with the NSJSONSerialization
class, it gives me an error i never faced.
Here is the JSon message I receive:
{"AuthenticationId":"6e5d3c5c-ce37-49b9-8331-047565181e91", "PropertyBag":[{"Key":"auth_id","Value":"6e5d3c5c-ce37-49b9-8331-047565181e91"},{"Key":"UserInfo","Value":"{\"FirstName\":\"thisIsTheFirstName\",\"LastName\":\"thisIsTheLastName\",\"E_Mail\":null,\"Region\":4,\"StoreDescription\":\"thisIsAStore\",\"SerializeImage\":\"傉䝎ਚ\u0000ഀ䡉剄\u0000㈀\u0000㈀؈\u0000Ḁ蠿±\u0000猁䝒B캮\u0000Ѐ䅧䅍\u0000辱ﰋա\u0000ऀ䡰獙\u0000쌎\u0000쌎윁ꡯd䤩䅄桔嵙홈ᡗ㫯摆䔔喋婎馶䆹బ⍳昚ᮙ嶵雕嶬暔숍荁떢镶ഛ䗚ێۍ䋭䨚㑞甒丷䎇縚쟠繬컫뿾츜\uffff꾞\udf57䆷샸鞟\uffff칽鹳칱鳳柟횄枰麄ဪ紐輌岍擹䨹ဠ啔쥙㊲\ud832鲦阜鶓꿗ﵧ﷽쓄쬄佌쿧䟛ꫴ猽羆㦯婽ﰔ螕넎쳬⹌♟琉䅊笁㔾붕箾⬷⤭⥡覉쿬鳐풟珗ᤙ楩포ឋ泃ؑ楤襩⚥넥緳ௌଋ䔥筼陱鲖샌␟䌨⌄ṀᏆ諗얋뱘箧矅▌伂蛢䨍蚇섁ీ텐\udd6f߳丧腨뇱⸱ᝋ摎҄\udbcf㦺㵥퐀ࠉ⍹⸘倪…앤疸鳫Дᶎ풶ỡɳ㼲윷嘧䮅ᙰ逓칸碎䎖ꕃﳩ㳼ꏗЇ㾡맞Ꮳ뢺좸벒蓘廬祹㿼逓Ⴤ␐쀫袘黧殗⟕䙏ࠏ설ॽ煱䉡ꚧ粦櫞⳰䮨银҄︾厣㢧鲏단ꋠ䋂맡탤ᔘᨚᳯၚ쯲ﯽ⌣븣藄ꂗ곬湯殌浭\udfe5짠쫉팊럳蟟螇Ἱ־귩ﯽ⺅đꂁ㮂㨺炸萨篆䭋쾋됫졘ᒫ쏆ꔰ奲览潮菵旗猍狶ﰞ뉗ཧ꼣ᷡꩡ냳杶㊇\ude63৲뵐伅誸䄰귣ꯋ땗萡答㭻틪懲翎㲞珡എ懶짉빉顁隩혨幬쌁逪᠕☯坃ሽ댓䂮ꫨ噇뱠ಘ沈汖\ud864뇕懩㒃콕趼碕婝⸗⏛뮧祷聿↲ꃸ紭兑ꃢ䗝費䥺껪왝샊☆靧焮健\ud943圞鈾嚃ꗁ娟襑핂견ⰼ\udaba쯳妗뛁\udc6d䇲\udffb룞뻁皺ᖍ\udcef昙ꇰ্ᄒ㶝啂견띜W抪\udf1c䁔黷ꔞⲂ怛뢾앲谙ဓ䓀悘湓腀㹎⥈襴췍㻍쾫躵܆ԇ믂㤋줁軵䡴鰱餷ﲨǀ斟ញ㥥郉閏뉔ﶨ쌥᪩袮摳晦ꥆ꺘ꄷ䛤ᐓ묌滯ᓞ뛖骝斐볙䈈阃睁덨\ude4c췦វꀊ友⤑殧⼱\udc6cȷⱁ蚻디ꪹ䌓㥙晙卓톓诐Ꭱ젖진覤䂌榾ၨㄖ⠥䀦Ḉ砾㾐綶烠Յꯧ⼨䖷䬌䔎쥘萈킖駠疬⣶琲稼擤⍌ਐ\udb2b慩ጎ⼥⛽傁빢澱ⱟ㕵䛊鋈쬞䈆陯ﶕ䁯鮐쐄⥔礻◄假퇬迥䯼阧ᆰ췰꒶蔯흌뀓厲뮲巜벼뭽ኲ…⪪阙ጣ깂潮ʲ냹媺▶꿵过膝ꡐ덠통歳阝辽ᗈ趍㧆ዥ\ude1fᇑ嵝䏀៵頮䐷갯伨⭭떧䅄匜抉̋ﲹ秐긬읻㦎閅됵ダ〰萠뛡䓕鹐䃀⃡\uda28፞ᗉ춰丛쁀▅Ί〼*⤅⮱劽⢄風⛤ꗎ璸ȆӁ舆ꋑ슚幌쪡䭊ዹ㷮볉匘卛季훿儜鑙屢☇뢨ꡨ씼鷎ꬽ㺲缾ߞ엸嬭䂜ф찄暸鸋峽ᵝჷׂ趿檇畕啎쁕Ꞌ궭徍痻㉸爒ࣶ蔉璢斖㶒쫡̋㮠钌آፂ簠❴됥⍜䟱䝇쇹煛酑θ舌﹂李꾣刯닿좁ꈳ鮰麞矦뢎ꏫ匐蕩䊰芈濷붶ᗉ呙뢀ᙎ빋ÿ䠦죥ᤸ嶔\u0000\u0000䕉䑎䊮艠\"}"}]}`
The error that Cocoa throws out is:
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Unable to convert hex escape sequence (no high character) to UTF8-encoded character.) UserInfo=0x688cfd0 {NSDebugDescription=Unable to convert hex escape sequence (no high character) to UTF8-encoded character.}