Closed Bug 92503 Opened 23 years ago Closed 23 years ago

window title should show non ASCII in MacOSX

Categories

(Core :: Internationalization, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: ftang, Assigned: ftang)

References

()

Details

(Keywords: intl, Whiteboard: MacOS X)

Attachments

(3 files)

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
do that.
Keywords: intl
QA Contact: andreasb → ylong
Hum... Here is some research result. Not 100% sure how to do it yet.
in
http://developer.apple.com/techpubs/macosx/Carbon/HumanInterfaceToolbox/WindowManager/Window_Manager/index.html
 SetWindowTitleWithCFString
OSStatus SetWindowTitleWithCFString (
    WindowRef inWindow, 
    CFStringRef inString
);
And this api will take a CFStrineRef 

And from
http://developer.apple.com/techpubs/macosx/CoreFoundation/Overview/CFOverview/index.html
it seems CFString is holding unicode.


we probably should create the CFStringRef from Unicode by calling
CFStringCreateWithCharacters (see
http://developer.apple.com/techpubs/macosx/CoreFoundation/Overview/CFOverview/index.html
)
The code which may want to change is in widget/src/mac/nsMacWindow.cpp

1169 NS_IMETHODIMP nsMacWindow::SetTitle(const nsString& aTitle)
1170 {
1171 Str255 title;
1172 // unicode to file system charset
1173 nsMacControl::StringToStr255(aTitle, title);
1174 ::SetWTitle(mWindowPtr, title);
1175 return NS_OK;
1176 }

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. 
Changing platform from PC to Macintosh as it refers to Mac OS X.
Hardware: PC → Macintosh
Targeting to Future, but since there's a fix-in-hand for this, let's get it
targeted to something pre-1.0.
Target Milestone: --- → Future
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
Target Milestone: Future → ---
Whatever.
can someone review the code ?
Status: NEW → ASSIGNED
Whiteboard: MacOS X
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
title bar. 

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.
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. 
sr=sfraser
set to m94
Target Milestone: --- → mozilla0.9.4
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.
Blocks: 22871
fixed and check in for MacOS X.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Switching qa contact to ruixi.  Rui, please verify.
QA Contact: ylong → ruixu
This bug has been fixed and confirmed with build 080905 and build 081005.
Status: RESOLVED → VERIFIED
Blocks: 103669
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: