Closed Bug 255192 Opened 18 years ago Closed 13 years ago

On Mac OS X, Unicode-based collation is not enabled (affects JS String.localeCompare, and nsICollation::compareString)


(Core :: Internationalization, defect)

Not set





(Reporter: jshin1987, Assigned: jaas)



(Keywords: intl)

In bug 95282, nsCollationMacUC was added, but it seems like it's never enabled
on OS X although nsCollationMacUC.cpp is compiled. 

In intl/locale/src/nsLocaleConstructors.h and intl/build/nsI18NModule.cpp, its
'registration' code is built conditionally depending on whether
'USE_UCCOLLATIONKEY' is defined or not. However, I don't think it's ever
defined. As a result, Mozilla still uses nsCollationMac (old non-Unicode based
collation) instead of nsCollationMacUC. 

I think we should use XP_MACOSX instead of USE_UCCOLLATIONKEY. Or, we have to
cvs remove nsCollationMac.cpp/h altogether and just keep nsCollationMacUC.cpp/h
because we don't support Mac OS 9 or earlier any more.

If I'm missing anything, please let me know.
I have vague recollections of the i18n folks running into OS bugs in the Mac OSX
collaction APIs. You should search through old bugs, or cvs blame the file and
look at related bugs that way.
Thanks for the hint.

I tried to figure out with 'cvs blame' before filing this bug, but it didn't
help because the history was lost by a couple of shuffling (nsI18NModule.cpp,
nsLocaleConstructors.h seem to have been added later). 

bugzilla turned up bug 121281 in which nhotta came up with four options (bug
121281 comment #2) for working around a problem with OS X collation APIs. The
first was to resort to non-Unicode collation APIs, but he didn't take that path. 

sfraser, do you think bug 121281 is the bug you vaguely recalled? perhaps not.
The original patch for bug 95282 uses '..CARBON...' in palce of
'USE_UCCOLLATIONKEY', but I can't find a bug in which '...CARBON...' was
replaced by 'USE_UCCOLLATIONKEY' (which is not defined to disable Unicode-based
With my patch (yet to be uploaded) applied, Mozilla starts fine, but when I open
a mail window, it crashes. Whatever the problem was, it appears to be still an
issue. Just in case, I'm rebuilding the whole tree after updating my source
tree. (perhaps, I'll try distclean as well....)
Duplicate of this bug: 421219
I think that bug 128323 is the bug that sfraser recalled where this was turned off. I investigated this in bug 421219 and had pretty much the same results as described in comment 3, except that in my case it was opening one of the menus that triggered a crash.
Summary: On Mac OS X, Unicode-based collation is not enabled → On Mac OS X, Unicode-based collation is not enabled (affects JS String.localeCompare, and nsICollation::compareString)
Blocks: 436589
Depends on: 488320
Crash fixed and unicode collation enabled in bug 488320.
Assignee: jshin1987 → joshmoz
Closed: 13 years ago
Hardware: PowerPC → All
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.