Closed Bug 125129 Opened 23 years ago Closed 23 years ago

Status messages not being converted to UTF8

Categories

(Core Graveyard :: Java: OJI, defect)

PowerPC
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: bnesse, Assigned: bnesse)

References

()

Details

Attachments

(2 files, 1 obsolete file)

The MRJ plugin for OS9, and I expect OSX as well, is passing status messages from the applet to the the plugin support code in the standard Mac character set rather than converting them to UTF8 which is what the plugin expects to receive. This is keeping us from displaying status text on any string not in the UTF8 bytecode range. The applet referenced above should display a copyright notice string in the status window. This is failing because the copyright symbol "©" has not been converted to UTF8.
Although the code path is completely different on OSX, I see the same results... the text does not show up in the status bar. OS -> All
Status: NEW → ASSIGNED
OS: Mac System 9.x → All
Target Milestone: --- → mozilla0.9.9
Attached patch proposed patch (OS 9 plug-in) (obsolete) — Splinter Review
This patch fixes the problem in the OS 9 plug-in.
Turns out that the OS X plug-in is trying to do the right thing. But the destination buffer isn't large enough to handle the additional characters inserted during the conversion to UTF-8 so it returns an empty buffer instead.
Patch which fixes the OS X plug-in. Also removes some dead code.
Comment on attachment 69332 [details] [diff] [review] Proposed patch (OS X) r=sdagley (* 2 is probably enough space but what the heck)
Attachment #69332 - Flags: review+
Comment on attachment 69262 [details] [diff] [review] proposed patch (OS 9 plug-in) I was going to question the use of delete[] on the result of ::JMTextToEncoding() but I have to question the call itself as I can't find it on a search of the Apple website and it's not in my JManager.h header. Am I missing some update?
> (* 2 is probably enough space but what the heck) To quote the voice from the other side of the wall when I said the same thing "That is very Euro-centric thinking". For the normal case, a couple of bytes would probably be fine. However in the worst case secenario, a Unicode character will be converted into a 3 byte UTF-8 representation. (Technically, according to the doc, you could have up to a 6 byte UTF-8 representation... but this is really special case...) >Am I missing some update? JMTextToEncoding is actually a locally defined function: http://lxr.mozilla.org/seamonkey/source/plugin/oji/MRJ/plugin/Source/MRJContext.cp#847 As to why it has :: in front of it you'd have to ask beard. I stole that code from something he had written elsewhere. I will remove the :: for clarity.
Comment on attachment 69332 [details] [diff] [review] Proposed patch (OS X) sr=beard
Attachment #69332 - Flags: superreview+
Comment on attachment 69262 [details] [diff] [review] proposed patch (OS 9 plug-in) r=sdagley (now that I understand the usage of JMTextToEncoding())
Attachment #69262 - Flags: review+
Comment on attachment 69262 [details] [diff] [review] proposed patch (OS 9 plug-in) You should make sure |JMTextToEncoding()| isn't returning NULL.
Attachment #69262 - Flags: needs-work+
Attached patch Better OS9 patchSplinter Review
Add null check for message before displaying and disposing.
Attachment #69262 - Attachment is obsolete: true
Comment on attachment 69690 [details] [diff] [review] Better OS9 patch sr=beard
Attachment #69690 - Flags: superreview+
Comment on attachment 69690 [details] [diff] [review] Better OS9 patch r=sdagley
Attachment #69690 - Flags: review+
One prefixes calls to functions with :: when one is explicitly calling a globally defined function, rather than another member function. It's a C++ style thing.
Both patches checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verified the patch.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: