DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36755>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36755





------- Additional Comments From [EMAIL PROTECTED]  2007-04-04 02:51 -------
Created an attachment (id=19912)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19912&action=view)
Suggested patch to load and save files in UTF-8 encoding

The problem is happening when saving the test plan. Currently, JMeter is using
default Java JRE file encoding to load and save files.

JMeter should rather use UTF-8, or other encoding specified in
saveservice.properties file.

This suggested patch add methods in SaveService, to load and save using
Input/OutputStream instead of InputReader/OutputWriter. Then SaveService takes
care of instantiating the InputReader and OutputWriter using the specified file
encoding, which by default is UTF-8 in the saveservice.properties file.

The xml header "<?xml version="1.0" encoding="UTF-8"?>" is written at the start
of the files. Note that the xstream parser ignores this, see
http://xstream.codehaus.org/faq.html#XML. But it is useful if you open the
files in other editors / browsers.

Note that I am closing the InputReader / OutputWriter in the SaveService
methods , this was not done previously. I have a habit of always closing things
I open.

I've looked at the places in the code where SaveService is used, and in about
half of the cases the stream sent in to SaveService is not closed by the
calling  code. I think I will go through the different classes that uses
SaveService, and make sure streams are closed in the same manner in all places.
But that will be another patch.

I haven't changed anything in org.apache.jmeter.reporters.ResultCollector, that
class is still using methods which I have marked as deprecated in SaveService.
I will wait and see if this patch suits you, and if it does, I might look into
making the ResultsCollector use more code from SaveService, and also not use
the deprecated methods. But it seems a bit complex to change the
ResultsCollector.
The ResultsCollector is currently hardcoded to using UTF-8.

Note that a lot of unit tests in TestSaveService fails, because the "xml
header" is added to the start of the files, which means that the file lenght
grows a little bit. If this patch is accepted, the testfiles should be changed
to contain the "xml header", and then the unit test will pass.

With this patch, Jmeter saves files as UTF-8, and it means that I can use UTF-8
as parameter values, for example copy / paste some Sanskrit characters from
http://www.columbia.edu/kermit/utf8.html
So I think this patch solves this bug.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to