Author Topic: Unicode collation  (Read 3457 times)

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Unicode collation
« on: March 23, 2021, 10:52:03 AM »
Why does this return -50?

Code: [Select]
UCCollateOptions options=kUCCollateStandardOptions;
const UniChar text1='a';
const UniChar text2='b';
Boolean equivalent;
SInt32 order;
OSStatus status=::UCCompareTextNoLocale(options,
                                        &text1,
                                        1,
                                        &text2,
                                        1,
                                        &equivalent,
                                        &order);

Offline teroyk

  • Platinum Member
  • *****
  • Posts: 623
  • -
Re: Unicode collation
« Reply #1 on: March 24, 2021, 08:34:37 AM »
Why does this return -50?
Code: [Select]
UCCollateOptions options=kUCCollateStandardOptions;
const UniChar text1='a';

Good question, I am not that far in unicode programming, but how we should define text1 when Unicode in Mac OS 9 is UTF-16BE = one char is 2 bytes?
btw. does OS 9 support only Unicode characters U+0000...U+FFFF and not characters that takes 4 bytes in UTF-16 (U+10000...U+10FFFF)  UTF-16 does not have 3 byte coding.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Unicode collation
« Reply #2 on: March 29, 2021, 08:59:27 AM »
This function is for Unicode, not UTF.