On 27 Feb 2013, at 01:04, Kyle Sluder <k...@ksluder.com> wrote: > On Feb 26, 2013, at 9:47 AM, "Gerriet M. Denkmann" <gerr...@mdenkmann.de> > wrote: > >> My investigations regarding archiving on OS X: >> >> 1. NSArchiver stores all strings in Utf-8. >> This is inefficient for strings which contain mainly non-european >> characters (e.g. Chinese or Thai) as one character will use 3 bytes (Utf-16 >> would use only 2). >> Corollary: It cannot store strings which contain illegal Unicode chars. > > NSString isn't designed to handle illegal Unicode characters either, so this > is not unexpected.
You can create and archive (with NSKeyedArchiver) illegal strings. unichar u = kUCHighSurrogateRangeStart; NSString *s = [ NSString stringWithCharacters: &u length: 1]; > >> >> 2. NSKeyedArchiver seems to be ok. > > OK in what way? I would hope it writes UTF-8 as well, rather than NSString's > internal UCS-2 representation. It uses whatever is shorter: Utf-8 or Utf-16. > > >> >> I have not reported these bugs, as I am convinced that Apple has no interest >> in fixing these problems. > > This is not a helpful attitude to take. When Apple helps me by fixing bugs, I will helping Apple by reporting them. Apple knows since years that NSKeyedUnarchiver is broken and does nothing. Gerriet. _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com