Skip to Main Content

Java Programming

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!

How to read a file's inputStream with RTFEditorKit and Convert it to UTF8?

870192Aug 11 2011 — edited Aug 17 2011
HI ALL, How to String Convert to UTF 8 ??? HELP me...........

private UploadedFile uploadedFile;
private RTFEditorKit kit;
kit = new RTFEditorKit();

Document doc = kit.createDefaultDocument();
// doc.putProperty("i18n", Boolean.TRUE);
InputStream is = getUploadedFile().getInputStream();
kit.read(is, doc, 0);
String s = doc.getText(0, doc.getLength());
String s1 = doc.getText(0, doc.getLength()); // this string is õýðãèéí áîëîí øõèéí õàðüÿàëàë çð÷ãé, íýõýìæëýëèéí áðäëáýð I wanna convert to this UTF 8 STRING ....

regards Ninja,,

Edited by: Ninja on Aug 11, 2011 7:04 PM

Edited by: Ninja on Aug 11, 2011 7:06 PM

Edited by: Ninja on Aug 16, 2011 2:26 AM

Edited by: Ninja on Aug 17, 2011 8:38 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 14 2011
Added on Aug 11 2011
21 comments
1,092 views