• 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
Re: How to get Unicode's "General Category" of a character?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get Unicode's "General Category" of a character?


  • Subject: Re: How to get Unicode's "General Category" of a character?
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 07 Jul 2015 20:10:23 +0700

> On 7 Jul 2015, at 19:33, Dmitry Markman <email@hidden> wrote:
>
> ICU’s
>
> u_charType

Looks exactly like what I need.
But: are the headers and the library on my Mac?

There is /usr/lib/libicucore.A.dylib which might contain u_charType, but I cannot find any headers (e.g. utypes.h).

Do I have to download the source from ICU?


Kind regards,

Gerriet.



>
>
>> On Jul 7, 2015, at 8:03 AM, Gerriet M. Denkmann <email@hidden> wrote:
>>
>> Given a character (a Unicode code point, to be exact) like U+FF0B (FULLWIDTH PLUS SIGN), I want to know the General Category of this.
>> For this example it would be “Sm" (aka. Math_Symbol or Symbol, Math).
>>
>> I could download the current version of UnicodeData.txt and parse it.
>> But this looks not very efficient.
>>
>> For punctuation one could use NSCharacterSet punctuationCharacterSet.
>>
>> But for Math Symbols?
>>
>> I did look at CFStringTransform, which can give the Character name via kCFStringTransformToUnicodeName.
>>
>> But I cannot find anything for “General Category"
>>
>> NSRegularExpression can match for [\p{General_Category = Math_Symbol}]; not quite what I want, but better than nothing.
>>
>>
>> Any ideas?
>>
>> Gerriet.
>>
>>
>> _______________________________________________
>>
>> 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
>
> Dmitry Markman
>


_______________________________________________

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: How to get Unicode's "General Category" of a character?
      • From: Dmitry Markman <email@hidden>
References: 
 >How to get Unicode's "General Category" of a character? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to get Unicode's "General Category" of a character? (From: Dmitry Markman <email@hidden>)

  • Prev by Date: Re: Possible to defer initialization of let variable?
  • Next by Date: Re: selectText of NSTextField on focus
  • Previous by thread: Re: How to get Unicode's "General Category" of a character?
  • Next by thread: Re: How to get Unicode's "General Category" of a character?
  • Index(es):
    • Date
    • Thread