Reading mail with charset in HTML meta tag produces exception

VERIFIED FIXED

Status

Grendel
Protocols
--
major
VERIFIED FIXED
13 years ago
13 years ago

People

(Reporter: mcsmurf, Assigned: R.J. Keller)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
I wanted to read some mail, but that produces some exception:
javax.swing.text.ChangedCharSetException
        at javax.swing.text.html.parser.DocumentParser.handleEmptyTag(Unknown So
urce)
        at javax.swing.text.html.parser.Parser.startTag(Unknown Source)
        at javax.swing.text.html.parser.Parser.parseTag(Unknown Source)
        at javax.swing.text.html.parser.Parser.parseContent(Unknown Source)
        at javax.swing.text.html.parser.Parser.parse(Unknown Source)
        at javax.swing.text.html.parser.DocumentParser.parse(Unknown Source)
        at javax.swing.text.html.parser.ParserDelegator.parse(Unknown Source)
        at javax.swing.text.html.HTMLEditorKit.read(Unknown Source)
        at javax.swing.text.JTextComponent.read(Unknown Source)
        at javax.swing.JEditorPane.read(Unknown Source)
        at grendel.ui.MessagePanel$LoadMessageThread.run(MessagePanel.java:287)
        at java.lang.Thread.run(Unknown Source)

The mail looks like this:
Return-Path:
<OWNER-NOLIST-EP-GrupoRealAlemania05-1-43-6-2-9*de*-comm*-software*-mozilla**GMX*-DE@BOUNCES.CORREODIRECT.COM>
X-Flags: 0000
Delivered-To: GMX delivery to de.comm.software.mozilla@gmx.de
Date: Wed, 11 May 2005 17:33:49
From: Europermission <promotion@europermission.com>
To: F <de.comm.software.mozilla@GMX.DE>
Subject: HÄUSER AM MITTELMEER
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Message-Id: <4282306A.00000275@mta1.correodirect.com>

<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
</html>

If i delete the <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"> line, everything works fine.
(Assignee)

Comment 1

13 years ago
Created attachment 184451 [details] [diff] [review]
Patch

possible solution but a little bit nasty. Basically it ignores HTML meta
content-type tags and uses only message headers.

After reading the documentation and talking with some people about this,
JEditorPane will always throw an exception when hitting a meta tag even if the
character encoding type is correct so this might be the only solution.
(Assignee)

Comment 2

13 years ago
Patch checked in.
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
(Reporter)

Comment 3

13 years ago
V. with a current build
Status: RESOLVED → VERIFIED
Summary: Reading mail produces exception → Reading mail with charset in HTML meta tag produces exception

Comment 4

13 years ago
This is a Swing issue, not a Grendel issue.

Comment 5

13 years ago
The stack trace should be provided to Sun as this is a Swing bug, not a Grendel bug; i.e., Swing should 
handle unrecognized tags better than this.
(Assignee)

Comment 6

13 years ago
(In reply to comment #5)
> The stack trace should be provided to Sun as this is a Swing bug, not a
Grendel bug; i.e., Swing should 
> handle unrecognized tags better than this.

I was reading a number of newsgroup posts about this, and it is the expected
action. You'll notice that it won't be thrown in cases where the URL is directly
read. This workaround works just fine though because it overrides sun's logic
and is appropriate in most cases but not in this one.

And it does recognize the tag. That's not the issue here. It's about the charset
changing because of a tag. I have a feeling that issues like this is why HTML
was disabled in Grendel before I re-enabled it.
You need to log in before you can comment on or make changes to this bug.