Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Unicode collation  (Read 5574 times)

OS923

  • 512 MB
  • *****
  • 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);
Logged

teroyk

  • 512 MB
  • *****
  • 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.
Logged

OS923

  • 512 MB
  • *****
  • Posts: 888
Re: Unicode collation
« Reply #2 on: March 29, 2021, 08:59:27 AM »

This function is for Unicode, not UTF.
Logged
Pages: [1]   Go Up

Recent Topics

[Off Topic] What did you do with your PowerPC Mac today? by smilesdavis Yesterday at 11:10:58 AM
[Off Topic] Music Faves by jojo2k Yesterday at 07:57:27 AM
[Hardware] Powerbook for OS9 and SVP by BimmyLee August 29, 2025, 09:53:37 PM
[Hardware] MDD Freeze / J20 RAM Slot by aBc August 29, 2025, 07:41:14 PM
[Hardware] G4 MDD only boots using ADC monitor power button by smilesdavis August 29, 2025, 09:31:06 AM
[Hardware] Rev A/B iMac Freezes on Startup by keithiepoo August 28, 2025, 04:42:38 AM
[Off Topic] Power Use by torvan August 27, 2025, 11:01:40 PM
[Mac OS 9, Hacks & Upgrades] help my b+w g3 450 is haunted! upgrading from 8.6 to 9.0 fine but 9.1 ruins it by DieHard August 27, 2025, 04:50:57 PM