Hi

My code observations :
JMeter test plan files (and probably other files written by Jmeter as well) are written using the default charater encoding of the JRE. The JMeter test plan files are also loaded using the default charater encoding of the JRE.
Example from the org.apache.jmeter.gui.action.Save class :
           if (SaveService.isSaveTestPlanFormat20()) {
               ostream = new FileOutputStream(updateFile);
               OldSaveService.saveSubTree(subTree, ostream);
           } else {
               writer = new FileWriter(updateFile);
               SaveService.saveTree(subTree, writer);
           }

My Jmeter usage observations :
If I paste some UTF-8 characters into a text field in JMeter, for example as the value of a HTTP request parameter, and then save the test plan, and reload it, my
UTF-8 characters are lost.

I have read a little bit about -Dfile.encoding, and on some platforms it seems like it is not possible to change the default character set encoding.
See for example bug 4163515 at java.sun.com

I see that the Xstream FAQ (http://xstream.codehaus.org/faq.html) has a question "Why does XStream not write XML in UTF-8?", where the answer says that a Writer with the correct encoding should be used.

My question :
Should JMeter test plan files always be written and read as UTF-8, instead of using default character set encoding of the JRE ? Or perhaps an option should be specified at save / load time, to allow the user to choose which encoding to use ?

As it is now, it's not easy for an user to get UTF-8 characters saved correctly to a test plan. And if the test plan has to be shared with other people, he would have to tell which encoding was used to save
the file.
This issue came to my attention while working to improve the i18n support in HTTP Request sampler and HTTP Proxy server.


Regards
Alf Hogemark

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to