This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes HTML Parsing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "HTML Parsing" Watch "HTML Parsing" New topic

HTML Parsing

Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
I am attempting to parse using javax.swing.text.html.HTMLEditrKit.Parser.
I am receiving a ChangedCharSetException because apparantly, the parser can't handle the <meta> tag.
"Googling" reveals a potential workaround to this problem, but I'd prefer not to use it, since it is quite a hack.
Does anyone have any better solutions to this problem ?

Tony Morris
Java Q&A (FAQ, Trivia)
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
I found a solution,
doc.putProperty("IgnoreCharsetDirective", new Boolean(true));
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

This is off-topic here; moving to Swing forum.

[Jess in Action][AskingGoodQuestions]
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
For HTML parsing, try this:
Don't get me started about those stupid light bulbs.
subject: HTML Parsing
It's not a secret anymore!