Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UTF-8 Unicode in JEditorPane doesn't work

843806Mar 26 2009 — edited Mar 27 2009
I do hope this is the correct forum for this question so that some forum nazi doesn't give me grief...here goes.

I have a JEditorPane with the contentType set to "text/html; charset=UTF-8"
I do a .setText method with this text:
<HTML><body><font face='Arial Unicode MS' size='3'>

Followed by some text extracted from an RSS feed (just the contents of the <description> tag)
and then </body></html> to finish it off.

It displays fine apart from a unicode character, it looks like one of those 'fancy' apostrophes so that in the word "We've" the appostrophe shows as an accented a and two squares as shown in this screenshot : Screenshot
So does that mean that 'Arial Unicode MS' cannot display Unicode as the name would suggest, or am I doing something else wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 24 2009
Added on Mar 26 2009
2 comments
963 views