We should show non ASCII in MacOS X window title. In the past, there are no API
to do that, but in the MacOS X , there seems have one. I try OmniWeb on MacOS X
and they can display that correctly on window title. We should find out how they
Hum... Here is some research result. Not 100% sure how to do it yet.
OSStatus SetWindowTitleWithCFString (
And this api will take a CFStrineRef
it seems CFString is holding unicode.
we probably should create the CFStringRef from Unicode by calling
The code which may want to change is in widget/src/mac/nsMacWindow.cpp
1169 NS_IMETHODIMP nsMacWindow::SetTitle(const nsString& aTitle)
1171 Str255 title;
1172 // unicode to file system charset
1173 nsMacControl::StringToStr255(aTitle, title);
1174 ::SetWTitle(mWindowPtr, title);
1175 return NS_OK;
Created attachment 43860 [details] [diff] [review]
patch Use SetWindowTitleWithCFString
can someone review this one?
Somehow when I run the carbon build on Mac, it will crash if I have this patch.
Not sure why?
I have not try on MacOS X yet.
Created attachment 44348 [details]
Basic testcase HTML with Shift JIS-encoded TITLE text.
Changing platform from PC to Macintosh as it refers to Mac OS X.
Targeting to Future, but since there's a fix-in-hand for this, let's get it
targeted to something pre-1.0.
greg, if you're not the owner of a bug please do not change the target milestone.
Unless of course you have the agreement of the bug owner
can someone review the code ?
My patch work nicely on MacOS X without problem. When I run in MacOS 9 with the
carbon build, it will crash the second time it set a non ASCII title to the
if you can provide a stacktrace of where it crashes, we can file a bug with
apple. i'd prefer not to check in anything we know crashes on carbon os9 since
even though we don't really support it, it might hork up embedding clients who
want to use it.
Created attachment 45010 [details] [diff] [review]
better fix which won't crash on MasOS 9
I have no way to produce a stack for the crash on MacOS 9 with the early patch.
It simply stop running and exist the running section without drop into debugger.
The new patch work better since it only go to the new api if it is running on
MacOSX or later.
set to m94
Reference also bug 36689 for this functionality under Classic Mac OS.
Reference also bug 74753 for this bug under Linux.
The patch for bug 22871 can be applied to Mac OS X once this bug is fixed.
fixed and check in for MacOS X.
Switching qa contact to ruixi. Rui, please verify.
This bug has been fixed and confirmed with build 080905 and build 081005.