Yes, quoted-printable. That's precisely it but in doing my research in the documentation and on the internet it doesn't seem like it's a simple process especially for someone like me with 9 months of Cocoa development experience.
Does anyone have a utility or sample code? On Jul 15, 2010, at 6:19 PM, Nick Zitzmann wrote: > > On Jul 15, 2010, at 4:03 PM, Brad Stone wrote: > >> I'm having trouble getting text to appear properly in an NSTextView which is >> binded to an NSData attribute in core data. I've been all over the internet >> but I'm still stumped. >> >> The original text looks like this: >> There is a period at the end of this sentence. >> You should have also just seen a line return and here • is a option-8 bullet >> character. >> >> This text is saved in an XML file that starts with <?xml version="1.0" >> encoding="UTF-8"?> >> >> My goal is to write code to read this XML file and create an NSData object >> for the text. This is what I've written: >> NSString *s = [childNode stringValue]; //assume this child is the correct >> text >> NSData *noteData = [s dataUsingEncoding:NSUnicodeStringEncoding >> allowLossyConversion:YES]; // I also tried NSUTF8StringEncoding >> >> This results in the following appearing in my NSTextView >> There is a period at the end of this sentence=2E=0DYou should have also jus= >> t seen a line return and here =E2=80=A2 is a option-8 bullet character= =2E >> >> >> I'd like to do the correct encoding but there's something wrong and I don't >> want to resort to the find and replace method. (i.e. find =2E and replace >> with ".") >> >> The actual text in the XML file is: >> <Note>There is a period at the end of this sentence=2E=0DYou should have >> also jus= >> t seen a line return and here =E2=80=A2 is a option-8 bullet character= >> =2E</Note> >> >> (why there's an = between the "s" and "t" in the word "just" is confusing). >> >> Can anyone help? > > Looks like you need to translate the text in the XML file using a MIME > quoted-printable decoder, and then run the results through a UTF-8 decoder. > Quoted-printable sequences start with a = and the next two characters > indicate the hex value of the character. For example, 0xe280a2 is the bullet > character (U+2022) in UTF-8. See RFC 2045 for more details. > > Nick Zitzmann > <http://www.chronosnet.com/> > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com