Re: Need localization-proof method of transporting dates.
Re: Need localization-proof method of transporting dates.
- Subject: Re: Need localization-proof method of transporting dates.
- From: Graham Cox <email@hidden>
- Date: Sat, 4 Apr 2009 23:29:14 +1100
On 04/04/2009, at 11:17 PM, Ken Thomases wrote:
Unless I've missed something, you left out an important part. How
are you storing/serializing the date information and later
"recovering" it?
Ah, good point ;-)
The date is added to a dictionary. The dictionary is then archived.
Decoding is simply dearchiving. The SHA-1 hash is stored in the same
dictionary as NSData. On decoding I can recover all the objects OK as
far as my own testing can establish - unfortunately getting a debug
trace on the tester's machine is not really possible, so exactly where
it's failing I can't be sure.
The reason I suspect the localisation is that an earlier version
definitely broke with system locale because I was using the -
description method of the date to compute the hash, not the -hash
method, and -description was being formatted according to the system
locale.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden