AM/PM letter UNICODE issues
AM/PM letter UNICODE issues
- Subject: AM/PM letter UNICODE issues
- From: Alex Kac <email@hidden>
- Date: Mon, 18 Oct 2010 12:19:28 -0500
I'm fairly certain my problem here is that I wasn't thinking about unicode terms here.
What we are trying to do:
Shorten the AM/PM to just the first character in Western Languages so that a time is shown as "1:30a".
NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
NSString* am = [[[formatter AMSymbol] substringToIndex:1] lowercaseString];
NSString* pm = [[[formatter PMSymbol] substringToIndex:1] lowercaseString];
This works in Western languages just fine. However in languages like Korean it does not work giving a random character seemingly. From reading on this list over time I believe its because I'm just getting one part of a multi-part character (I'm no good with unicode terms sorry).
My guess is I need to use rangeOfComposedCharacterSequenceAtIndex and then get the range and use a substring with that range. But I'm not sure since my knowledge here is pretty limited. Would love some direction. Thanks!_______________________________________________
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