Any difference between UTF-8 and utf8 for XML on different systems?

M

Manoj Nair

I am using following code to create an XML file and which is rendered
into a PDF by using XMLParser and then FOP. This works fine on windows
system. But when I port the code to Unix I get "utf8 encoding error".
Is there a different way I need to represent the string "utf8" on unix
? Thanks

FileOutputStream fileoutstream = new FileOutputStream(foFile);
Writer writer = new OutputStreamWriter(fileoutstream, "utf8");
writer.write(foDoc.toString().trim());
writer.close();
 
M

Martin Honnen

Manoj said:
I am using following code to create an XML file and which is rendered
into a PDF by using XMLParser and then FOP. This works fine on windows
system. But when I port the code to Unix I get "utf8 encoding error".
Is there a different way I need to represent the string "utf8" on unix
? Thanks

FileOutputStream fileoutstream = new FileOutputStream(foFile);
Writer writer = new OutputStreamWriter(fileoutstream, "utf8");
writer.write(foDoc.toString().trim());
writer.close();

It doesn't really look like an XML problem, I guess what you have above
is Java code so maybe someone in comp.lang.java.help can help better if
you provide some more details on the Java version used, the XMLParser
used, the exact line causing the error, the input causing the error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top