P
peter10
Hi everybody,
I would like to convert unicode text (coming from a swing JTextPane -
I think that is unicode by default!?) to UTF-8. I tried the code
underneath, but the xml-database I am using still complains about
wrong characters (error message: "Invalid byte 2 of 3-byte UTF-8
sequence").
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(out);
dataOut.writeUTF(text_input);
String text_output = out.toString("UTF-8");
Can anybody tell me what the mistake is that I am making???
Thanks a lot for your help!
Peter
I would like to convert unicode text (coming from a swing JTextPane -
I think that is unicode by default!?) to UTF-8. I tried the code
underneath, but the xml-database I am using still complains about
wrong characters (error message: "Invalid byte 2 of 3-byte UTF-8
sequence").
ByteArrayOutputStream out = new ByteArrayOutputStream();
DataOutputStream dataOut = new DataOutputStream(out);
dataOut.writeUTF(text_input);
String text_output = out.toString("UTF-8");
Can anybody tell me what the mistake is that I am making???
Thanks a lot for your help!
Peter