ah, thanks for the catch. I changed this in two places:
XMLResultWriter(File)
and
Survey#saveXMLAnswers(String)
This is checked into the SVN. My next task is to add a menu bar to JSurveyLib that allows you to save/load surveys at any time. After that, I'll probably make a release that will include this fix.
Thanks again,
Dan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
oh and BTW, I think you *could* have worked around this bug by using Survey#saveXMLAnswers(Writer). Am I wrong about that? I think you could have passed in new OutputStreamWriter(new FileOutputStream(outputXMLFile),"UTF-8") to that method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I don't know if my posting is at the right place, actually i am new to sourceforge and the hole thing, so please correct me.
back to my topic:
I just found out, when i use your survey i get utf8 failures like
java.io.UTFDataFormatException: invalid byte 2 of 2-byte UTF-8 sequence (0x62)
when i open the result.xml
this is because you used the java.io.filewiter which hasn't utf8 encoding
so i edited your saveXMLAnswers
+
OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(outputXMLFile),"UTF-8");
-
writer = new FileWriter(new File(outputXMLFile));
maybe you will aply my changes
here is the reference i used to fix the problem:
http://www.malcolmhardie.com/weblogs/angus/2004/10/23/java-filewriter-xml-and-utf-8/
btw your tool saved me a lot of time thank you
greetings Konrad
ps: please ignore my bad spelling
ah, thanks for the catch. I changed this in two places:
XMLResultWriter(File)
and
Survey#saveXMLAnswers(String)
This is checked into the SVN. My next task is to add a menu bar to JSurveyLib that allows you to save/load surveys at any time. After that, I'll probably make a release that will include this fix.
Thanks again,
Dan
oh and BTW, I think you *could* have worked around this bug by using Survey#saveXMLAnswers(Writer). Am I wrong about that? I think you could have passed in new OutputStreamWriter(new FileOutputStream(outputXMLFile),"UTF-8") to that method.
yes of cause, but that woundln't solve the bug with the FileWriter.
right :) just wanted to make sure. Thanks
FYI, i modified all FileReaders in similar ways