Re: UTF-16 encoded HTML
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 14:47:08 GMT
"Stephan Zimmermann" <s.zimmermann@xxxxxxxxxxxxxxxx> wrote in message
news:df4ak2$31n$05$1@xxxxxxxxxxxxxxxxxxxx
> Hi all,
> I have a HTML file, encoded in UTF-16, which my webbrowsers can display
> very
> well. But when I load the same URL into JEditorPane, I only see some ugly
> boxes and other trash.
> <code>
> JEditorPane ep = new JEditorPane(fileURL);
> </code>
>
> I also tried to read the content of the file over an FileInputStream,
> which
> leads to a nice view of the HTML code.
> <code>
> InputStreamReader in = new InputStreamReader(new
> FileInputStream(fileURL.getFile()),"UTF-16");
> ep.read(in,"text/html; charset=UTF-16");
> </code>
>
> Is there a way to display a UTF-16 encoded HTML file? Or is there another
> (easy) way to show (formatted) Information in multiple languages without
> using different encodings?
Did you try reading it via the InputStreamReader (as per the second
example), and then passing the string read-in to the JEditorPane?
- Oliver
.
- References:
- UTF-16 encoded HTML
- From: Stephan Zimmermann
- UTF-16 encoded HTML
- Prev by Date: Re: Adding Elments to JComboBox
- Next by Date: Re: UTF-16 encoded HTML
- Previous by thread: Re: UTF-16 encoded HTML
- Next by thread: Getting a Component name as a string
- Index(es):
Relevant Pages
|