Last Comment Bug 92503 - window title should show non ASCII in MacOSX
: window title should show non ASCII in MacOSX
Status: VERIFIED FIXED
MacOS X
: intl
Product: Core
Classification: Components
Component: Internationalization (show other bugs)
: Trunk
: PowerPC Mac OS X
: -- normal (vote)
: mozilla0.9.4
Assigned To: Frank Tang
: Rui Xu
Mentors:
http://home.netscape.com/zh/tw
Depends on:
Blocks: 22871 103669
  Show dependency treegraph
 
Reported: 2001-07-26 16:47 PDT by Frank Tang
Modified: 2001-08-10 12:26 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch Use SetWindowTitleWithCFString (990 bytes, patch)
2001-07-27 18:30 PDT, Frank Tang
no flags Details | Diff | Splinter Review
Basic testcase HTML with Shift JIS-encoded TITLE text. (359 bytes, text/html)
2001-08-01 23:31 PDT, Greg K.
no flags Details
better fix which won't crash on MasOS 9 (1.28 KB, patch)
2001-08-07 18:04 PDT, Frank Tang
no flags Details | Diff | Splinter Review

Description Frank Tang 2001-07-26 16:47:01 PDT
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.
Comment 1 Frank Tang 2001-07-26 17:10:23 PDT
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.


Comment 2 Frank Tang 2001-07-26 17:11:32 PDT
we probably should create the CFStringRef from Unicode by calling
CFStringCreateWithCharacters (see
http://developer.apple.com/techpubs/macosx/CoreFoundation/Overview/CFOverview/index.html
)
Comment 3 Frank Tang 2001-07-26 17:15:32 PDT
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 }

Comment 4 Frank Tang 2001-07-27 18:30:54 PDT
Created attachment 43860 [details] [diff] [review]
patch Use SetWindowTitleWithCFString
Comment 5 Frank Tang 2001-07-27 18:31:52 PDT
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 Greg K. 2001-08-01 23:31:30 PDT
Created attachment 44348 [details]
Basic testcase HTML with Shift JIS-encoded TITLE text.
Comment 7 Greg K. 2001-08-01 23:32:08 PDT
Changing platform from PC to Macintosh as it refers to Mac OS X.
Comment 8 Greg K. 2001-08-03 19:18:31 PDT
Targeting to Future, but since there's a fix-in-hand for this, let's get it
targeted to something pre-1.0.
Comment 9 Steve Dagley 2001-08-03 19:27:34 PDT
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
Comment 10 Greg K. 2001-08-03 20:20:22 PDT
Whatever.
Comment 11 Frank Tang 2001-08-06 12:59:37 PDT
can someone review the code ?
Comment 12 Frank Tang 2001-08-06 13:06:29 PDT
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. 

Comment 13 Mike Pinkerton (not reading bugmail) 2001-08-06 13:57:04 PDT
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.
Comment 14 Frank Tang 2001-08-07 18:04:22 PDT
Created attachment 45010 [details] [diff] [review]
better fix which won't crash on MasOS 9
Comment 15 Frank Tang 2001-08-07 18:05:39 PDT
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 Simon Fraser 2001-08-07 18:14:05 PDT
sr=sfraser
Comment 17 Frank Tang 2001-08-08 13:43:05 PDT
set to m94
Comment 18 Greg K. 2001-08-08 15:10:16 PDT
Reference also bug 36689 for this functionality under Classic Mac OS.
Comment 19 Greg K. 2001-08-08 15:15:57 PDT
Reference also bug 74753 for this bug under Linux.
Comment 20 Greg K. 2001-08-08 15:22:58 PDT
The patch for bug 22871 can be applied to Mac OS X once this bug is fixed.
Comment 21 Frank Tang 2001-08-09 05:12:48 PDT
fixed and check in for MacOS X.
Comment 22 Andreas Becker 2001-08-09 10:18:25 PDT
Switching qa contact to ruixi.  Rui, please verify.
Comment 23 Rui Xu 2001-08-10 12:26:06 PDT
This bug has been fixed and confirmed with build 080905 and build 081005.

Note You need to log in before you can comment on or make changes to this bug.