Closed Bug 347503 Opened 14 years ago Closed 3 years ago

Non-ASCII characters don't display in the titlebar even with correct codepage set

Categories

(Core Graveyard :: Widget: OS/2, defect, minor)

x86
OS/2
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mozilla, Assigned: mkaply)

Details

Attachments

(1 file)

This was discussed in the mozilla.dev.ports.os2 newsgroup a while ago. I thought that I should copy it here so that it doesn't get completely forgotten.

Stan Goodman:
> It seems to be more complicated. I often see the "??????????" in the 
> titlebar on Hebrew pages, although my primary codepage is 862, which is 
> Hebrew.
Stan also uses "Lucida Sans Unicode" as titlebar font, so that rules out one possibility.


Mike Kaply:
> The code involved in this is here:
> 
> http://lxr.mozilla.org/seamonkey/source/widget/src/os2/nsWindow.cpp#3653
> 
> Basically we get a unicode string from Mozilla and do a 
> WideCharToMultibyte to convert it to the native codepage.
> 
> That's implemented here:
> 
> http://lxr.mozilla.org/seamonkey/source/gfx/src/os2/nsOS2Uni.cpp#139
> 
> In the title bar case, we pass in a codepage of 0 which hits this code:
> 
> http://lxr.mozilla.org/seamonkey/source/gfx/src/os2/nsOS2Uni.cpp#92
> 
>  92         if (aCodePage == 0) {
>  93           nsCOMPtr<nsIPlatformCharset>
>  94                 plat(do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv));
>  95           if (NS_SUCCEEDED(rv)) {
>  96             plat->GetCharset(kPlatformCharsetSel_FileName, charset);
>  97           } else {
>  98             // default to IBM850 if this should fail
>  99             charset = "IBM850";
> 100           }
> 101           convname = charset.get();
> 102         } else {
> 103           convname = gConverterInfo[i].mConvName;
> 104         }
> 
> Which gets the system code page using this code:
> 
> http://lxr.mozilla.org/seamonkey/source/intl/uconv/src/nsOS2Charset.cpp#148
> 
> I'm wondering if somehow mCharset isn't set when we hit this code?


Peter Weilbacher:
> > I'm wondering if somehow mCharset isn't set when we hit this code?
> 
> No, it always gets set in the nsPlatformCharset constructor via
> MapToCharset. cp862 is contained in os2charset.properties, just as
> cp850, so that should work. I don't want to mess up my system, so I
> hesitate to really set it to use cp862...
> 
> I never saw this direct assigment
>    charset = "IBM850"
> in any code using XPCOM strings before but that should not cause the
> failure.
Again, from the newsgroup:

Michael Kaply wrote:
> Peter Weilbacher wrote:
> > So I don't understand the comment
> >   //delay loading os2charset.properties bundle if possible
> > (in MapToCharset at nsOS2Charset.cpp line 101) because that already
> > happens in the constructor. Perhaps I should try removing it and the
> > first two hardcoded codepage cases in that function.
> 
> Yeah, that doesn't really make sense. In the old days, we hardcoded the 
> most "common" codepages to avoid the call to load the bundle, but 
> clearly nsOS2Charset.cpp loads the bundle...

This patch removes that. But it clearly doesn't fix the original problem, so for now I won't ask for review.
Product: Core → Core Graveyard
OS/2 is an unsupported platform.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.