• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AM/PM letter UNICODE issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: AM/PM letter UNICODE issues
      • From: Todd Dombrowski <email@hidden>
    • Re: AM/PM letter UNICODE issues
      • From: Conrad Shultz <email@hidden>
    • Re: AM/PM letter UNICODE issues
      • From: Quincey Morris <email@hidden>
    • Re: AM/PM letter UNICODE issues
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: [Q] Using NSInvocation vs. selector with NSTimer
  • Next by Date: NSOperation completionBlock not executed
  • Previous by thread: [SOLVED] Re: [Distant Objects] Problem passing custom objects bycopy
  • Next by thread: Re: AM/PM letter UNICODE issues
  • Index(es):
    • Date
    • Thread