Search code examples
mysqlsortingsqlitelocaleicu

ICU Collator Base on Locale and Customize Rule


If its possible to use Collator of ICU collation service which is base on both simultaneously :

  1. Locale base like "ko_KR" ( coll = ucol_open("ko_KR", &status) )

  2. Customized Rules ie "tailoring" ( coll = ucol_openRules(rlz, rlen, UCOL_OFF,UCOL_TERTIARY,NULL,&status) )

Collator_Final = Collator_Locale + Collator_customize_rule

If yes, then please suggest how we can use collator base on both at same time?


Solution

  • There was a reply on the mailing list to your question here

    To summarize and expand:

    1. You can get the rules needed for a collator from ICU, using ucol_getRules()
    2. You can concatenate those base rules (such as ko_KR) with your custom rules.