I'm having trouble converting binary data (some text) back to a string.
The original text comes from a JSON feed, and is then convertet into binary data to store (with the correct formatting) in CoreData. My problem is getting it back out of CoreData. When I try to convert it with the following: NSString *howToString = [[NSString alloc]initWithBytes:[dish.dishMainText bytes] length:[dish.dishMainText length] encoding:NSASCIIStringEncoding];
I get the following:
bplist00‘T$topX$objectsX$versionY$archiver—TrootÄ¢
U$nulloÚ1 kage
R¯r sukker, kakao og vanillekorn i sm¯rret. Pisk Êggene i et ad gangen, og tilsÊt til sidst melet. Fordel dejen i en smurt form p 24 cm. Bag kagen i ca. 20 minutter nederst i ovnen ved 175∞.
Giv piskefl¯de og sm¯r et lille opkog. TilsÊt appelsinskal og chokolade, og lad den smelte ved lav temperatur. R¯r rundt i blandingen. HÊld chokoladeblandingen i en skÂl og sÊt den koldt. Fordel den faste tr¯ffelmasse ud over den afk¯lede kage.
Server evt. kagen pyntet med blandede bÊr.܆_NSKeyedArchiver(25:<?E-2
D
As you can see, in the beginning and in the end there is some text that is not properly converted. I have tried different forms of encoding (UTF, Latin1/2 and so on) but nothing seems to work perfectly. This is the best result I have been able to produce so far, but it's obviously not satisfactory.
Let me know if more code is needed.
Thanks in advance Chris