Closed
Bug 99047
Opened 24 years ago
Closed 23 years ago
Japanese string passed with <param> is displayed as garbage
Categories
(Core Graveyard :: Java: OJI, defect)
Core Graveyard
Java: OJI
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: kazhik, Assigned: joshua.xia)
References
Details
(Keywords: intl, testcase, Whiteboard: [jpibug])
Attachments
(3 files)
Japanese string passed to Java applet with <param> is displayed as garbage.
http://www.seinengekijo.co.jp/
See the top of the right frame.
http://bugzilla.mozilla.gr.jp/show_bug.cgi?id=1343
Comment 1•24 years ago
|
||
It seems that getParameter() returns UTF-8 like byte array.
For example, "e3 81 82 61" (in UTF-8) -> "ffe3 ff81 ff82 61".
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
Comment 4•24 years ago
|
||
Reassign to Joe as I'm leaving the role of OJI module owner.
Target Milestone: --- → mozilla0.9.5
Ressign to Joe Chou, as I am no longer working officially on OJI.
Assignee: edburns → joe.chou
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Re-assign to sep.
Assignee: joe.chou → sep
Target Milestone: mozilla0.9.6 → mozilla0.9.9
Comment 8•24 years ago
|
||
I think this is the dup of bug #102640
Comment 9•24 years ago
|
||
oh, but this one looks like it has a nice testcase and the reporter says it may
be with getParameter/s. In ObjectFrame.cpp, it almost looks like someone had
tried to do some converting before but it's commented out.
cc:ing Andrei who I think just fixed a similar, non-related, intl string
converting bug. Changing platform to ALL as it's probably in XP code.
Comment 10•24 years ago
|
||
Either html author should use UTF8 for strings or we need
to convert params/attrs from document charset to UTF8, but latter
will make layout depend on uconv (as far as nsPluginInstanceOwner
is in nsObjectFrame.cpp, which is in layout). I don't think that
this is good, so we probably should move nsPluginInstanceOwner in
its own file in modules/plugin (yuck ;-) ). Having plugin depends
on uconv is not so bad.
Peter, what do you think? Fix or close?
Comment 11•24 years ago
|
||
In my opinion it would be correct to convert parameter strings
if they are not in UTF8. HTML specs
(http://www.w3.org/TR/html4/struct/objects.html) do not mention
any rules for charset. Therefore we can not expect web page author to
always use UTF-8 strings.
As for dependency on uconv i do not think this is really a big problem.
Layout already has dependency on it - see
http://lxr.mozilla.org/mozilla/source/layout/base/src/Makefile.in#42
or http://lxr.mozilla.org/mozilla/source/layout/html/forms/src/Makefile.in#46.
Comment 12•24 years ago
|
||
lsv: I can take it, if you don't mind
Comment 15•24 years ago
|
||
My bad, comment #10 was just stupid.
After some investigation looks like we're doing all right.
Cc'ing skatz@east.sun.com. Steven, is this java/java plugin issue?
Comment 16•24 years ago
|
||
Well, after some debugging it turned out to be java plugin bug.
Mozilla passes arguments and parameters as UTF8 string. But
plugin code assumes that those strings are in ISO8859-1 encoding.
Steven, that's yours :-)
(see Pligin.readString in
ext/plugin/java/src/sun/plugin/navig/motif/Plugin.java)
Whiteboard: [jpibug]
Target Milestone: mozilla0.9.9 → ---
Comment 17•24 years ago
|
||
Ok, thanks for the debug. I'll check it out.
Comment 18•24 years ago
|
||
Since I don't have the Japanese character set installed on my machine. Could
someone tell me what integer values I should expect to see printed out to the
Java Console by this applet?
Comment 19•24 years ago
|
||
Based on my testing the Browser (Netscape 6.2.1 beta on Solaris) appears to be
handing us 4 bytes to incode the string. I'm guessing that this is 3 bytes for
the first character (the Japanese one) and one byte for the "a".
Anyway, this seems to indicate that the browser is not passing us a UTF-8
representation of the string (as implied by comment #16), but a mutli-byte
representation.
BTW, an anyone point me at the doc that specifies what encoding
Mozilla/Netscape6 is suppose to pass strings around in? How about the same doc
for Netscape 4?
Comment 20•24 years ago
|
||
That japanese char is HIRAGANA LETTER A (3042 in unicode)
and those three bytes are UTF8 representations of that character: e3 81 82.
(61 is latin 'a'). So we're passing utf8 :-)
As for mozilla strings, they can be unicode or utf8. As far as plugin interfaces uses char*, we have to use utf8 strings.
Comment 21•24 years ago
|
||
Sorry, my bad. I was changing one set of sources but testing against a
different set. For Mozilla/Netscape switching to UTF-8 seems to fix the
problem. I've filed a bugtraq bug (Sun's bug system) against this problem so we
can put back the change. [bugtraq: 4652828]
Any idea what the standard for Netscape 4 is? It doesn't seem to be UTF-8.
Also, I note that GetDocumentEncoding() on nsIPluginTagInfo2 interface always
seems to return NULL. Any ideas about that?
Comment 22•24 years ago
|
||
GetDocumentEncoding() of nsIPluginTagInfo2 is just not implemented
(it's "return NS_ERROR_FAILURE").
If you need it. I can implement this.
Comment 23•24 years ago
|
||
It would be great if you could implement GetDocumentEncoding(), thanks. BTW, I
have made the changes to the java code, I'm just waiting for a code review to
check it in. You should see it working in the 1.4.1 release of Java.
Any idea how to do the same thing that GetDocumentEncoding() will do, but in
Netscape 4?
Comment 24•24 years ago
|
||
I can say nothing about NS4 :-(
This is question for netscape guys.
Peter, Andrei, could you shed some light on this?
I'm not sure this is possible...
Comment 25•24 years ago
|
||
I filed bug #131197 about GetDocumentEncoding
Comment 26•24 years ago
|
||
*** Bug 102640 has been marked as a duplicate of this bug. ***
| Assignee | ||
Comment 27•24 years ago
|
||
This bug is a duplicate of #136103
I wrote two workrounds on custom side.
they work. and this bug was fixed on JPI side
See #136103
-------------Sun China ERI--------------------
Comment 28•24 years ago
|
||
which version of java plugin is fixed?
Comment 29•24 years ago
|
||
*** Bug 136103 has been marked as a duplicate of this bug. ***
Comment 30•24 years ago
|
||
Is this fixed? GetDocumentEncoding was implemented by Denis in bug #131197.
Comment 31•24 years ago
|
||
This fix for this one is going to show up in JRE 1.4.1.
| Assignee | ||
Comment 32•24 years ago
|
||
Yeah.
I tested in JRE1.4.1, This bug has been fixed in JRE1.4.1
Wait for release.
------------Sun China ERI--------------------------------
Comment 33•24 years ago
|
||
removing myself from cc:
| Assignee | ||
Comment 35•24 years ago
|
||
This is bug of JPI, and it is fixed in jre1.4.1 (haven't released)
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → LATER
Comment 36•24 years ago
|
||
Hello All !
I've downloaded new Sun Java 1.4:
/usr/java/j2re1.4.0_01
and the bug is still there.
Visiting the original
sedmoycanal.com
I still see unreadable cyrillic text being scrolled, though now, instead
of rectangels, I see non-cyrillic letters with accents.
Windows 98 version of Mozilla works fine.
Regards,
Sergei.
Status: RESOLVED → REOPENED
Resolution: LATER → ---
| Assignee | ||
Comment 37•24 years ago
|
||
This bug is fixed in JPI1.4.1 which will be released in this September.
On Unix, Add the following code into Applet, it can get right unicode parameter.
String param = "";
try {
String temp = getParameter(name); //name is the key of parameter
BufferedReader reader = new BufferedReader(new InputStreamReader(
new StringBufferInputStream(temp), "UTF-8"));
param = reader.readLine();
} catch (Exception e) {
}
This workaround work well.
Comment 38•23 years ago
|
||
Chris Petersen is a new QA contact for oji component. His email is:
petersen@netscape.com
Assignee: joe.chou → petersen
Status: REOPENED → NEW
Comment 39•23 years ago
|
||
fixing small error for pmac@netscape.com (filter with : SPAMMAILSUCKS)
Assignee: petersen → joe.chou
QA Contact: pmac → petersen
Comment 40•23 years ago
|
||
*** Bug 136103 has been marked as a duplicate of this bug. ***
Comment 42•23 years ago
|
||
Closing per comment 37
Status: NEW → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → FIXED
Comment 43•23 years ago
|
||
-- Verified on latest trunk build(20030521) on WinXP with JRE1.4.2_beta. Works
fine. Marking VERIFIED.
Status: RESOLVED → VERIFIED
QA Contact: petersen → dsirnapalli
You need to log in
before you can comment on or make changes to this bug.
Description
•