window title should show non ASCII in MacOSX

VERIFIED FIXED in mozilla0.9.4

Status

()

Core
Internationalization
VERIFIED FIXED
16 years ago
16 years ago

People

(Reporter: Frank Tang, Assigned: Frank Tang)

Tracking

({intl})

Trunk
mozilla0.9.4
PowerPC
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: MacOS X, URL)

Attachments

(3 attachments)

(Assignee)

Description

16 years ago
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.

Updated

16 years ago
Keywords: intl
QA Contact: andreasb → ylong
(Assignee)

Comment 1

16 years ago
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.


(Assignee)

Comment 2

16 years ago
we probably should create the CFStringRef from Unicode by calling
CFStringCreateWithCharacters (see
http://developer.apple.com/techpubs/macosx/CoreFoundation/Overview/CFOverview/index.html
)
(Assignee)

Comment 3

16 years ago
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 }

(Assignee)

Comment 4

16 years ago
Created attachment 43860 [details] [diff] [review]
patch Use SetWindowTitleWithCFString
(Assignee)

Comment 5

16 years ago
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. 

Comment 6

16 years ago
Created attachment 44348 [details]
Basic testcase HTML with Shift JIS-encoded TITLE text.

Comment 7

16 years ago
Changing platform from PC to Macintosh as it refers to Mac OS X.
Hardware: PC → Macintosh

Comment 8

16 years ago
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

Comment 9

16 years ago
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 → ---

Comment 10

16 years ago
Whatever.
(Assignee)

Comment 11

16 years ago
can someone review the code ?
Status: NEW → ASSIGNED
Whiteboard: MacOS X
(Assignee)

Comment 12

16 years ago
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.
(Assignee)

Comment 14

16 years ago
Created attachment 45010 [details] [diff] [review]
better fix which won't crash on MasOS 9
(Assignee)

Comment 15

16 years ago
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. 

Comment 16

16 years ago
sr=sfraser
(Assignee)

Comment 17

16 years ago
set to m94
Target Milestone: --- → mozilla0.9.4

Comment 18

16 years ago
Reference also bug 36689 for this functionality under Classic Mac OS.

Comment 19

16 years ago
Reference also bug 74753 for this bug under Linux.

Comment 20

16 years ago
The patch for bug 22871 can be applied to Mac OS X once this bug is fixed.
Blocks: 22871
(Assignee)

Comment 21

16 years ago
fixed and check in for MacOS X.
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 22

16 years ago
Switching qa contact to ruixi.  Rui, please verify.
QA Contact: ylong → ruixu

Comment 23

16 years ago
This bug has been fixed and confirmed with build 080905 and build 081005.
Status: RESOLVED → VERIFIED

Updated

16 years ago
Blocks: 103669
You need to log in before you can comment on or make changes to this bug.