Flexible File Write - Possible to write UTF-8 or Unicode to HTML?

179 views
Skip to first unread message

John P

unread,
Jul 22, 2015, 3:10:44 AM7/22/15
to jmeter-plugins
I am creating a HTML report.
Everything works well except all special characters write to the file as Question Marks (?)
All of my other Jmeter reports output special characters just fine.

Some of the characters in question are:  (  ●  ↑    ҈    )

Looking at the configuration, it looks like the File Writer is actually writing Question marks, and not Unicode that is being misinterpreted by the browser.

Example:

Local IP Address173301970isSuccessful200
? ? Verify JMeter OS from childbuild ? ?6502420isSuccessful200
? ? NMS Server IP: 127.0.0.1 ? ? 2686268647702isSuccessful200
? ? NMS Server Version: 7.0.2.223 ? ?1111112702isSuccessful200
? ? JMeter 2.13 r1665067 (Linux) ? ?66112702isSuccessful200

it should be:

Local IP Address173301970isSuccessful200
● ● Verify JMeter OS from childbuild ● ●6502420isSuccessful200
● ● NMS Server IP: 127.0.0.1 ● ● 2686268647702isSuccessful200
● ● NMS Server Version: 7.0.2.223 ● ●1111112702isSuccessful200
● ● JMeter 2.13 r1665067 (Linux) ● ●66112702isSuccessful

200


John P

unread,
Jul 22, 2015, 3:23:44 AM7/22/15
to jmeter-plugins

The entire detail line is:
<tr>\r\n\t<td style=" text-align:left;"><font style="color: DarkSlateBlue;"><b>|sampleLabel|</b></font></td><td>|responseTime|</td><td>|latency|</td><td>|sentBytes|</td><td>|receivedBytes|</td><td>|isSuccessful|</td><td>|responseCode|</td>\r\n</tr>\r\n

Example: ( |sampleLabel| ) field

Andrey Pokhilko

unread,
Jul 23, 2015, 4:46:14 AM7/23/15
to jmeter-plugins, pac...@gmail.com, pac...@gmail.com
Hi,

JMeter has its own internal encoding setting, from property sampleresult.default.encoding. It manages the representation of data. Maybe your unicode is lost somewhere it is put into SampleResult.

--
Andrey

среда, 22 июля 2015 г., 10:23:44 UTC+3 пользователь John P написал:

John P

unread,
Jul 23, 2015, 7:34:40 AM7/23/15
to jmeter-plugins


On Thursday, July 23, 2015 at 11:46:14 AM UTC+3, Andrey Pokhilko wrote:
Hi,

JMeter has its own internal encoding setting, from property sampleresult.default.encoding. It manages the representation of data. Maybe your unicode is lost somewhere it is put into SampleResult.


sampleresult.default.encoding

Is this a property I can set in the jmx?
I am running it both locally and through Maven on Hudson, so my abilty to make changes on the fly are limited. 

In both jmeter.properies and user.properties I set this to:

sampleresult.default.encoding=UTF-8

it had absolutely no effect on the output.
I have a feeling that something is different about your plugin, as all other Jmeter outputs are presented correctly.

Thanks

Vladimir Sitnikov

unread,
Jul 23, 2015, 7:09:18 PM7/23/15
to jmeter-plugins
John,
Can you please try adding -Dfile.encoding=UTF-8 java option?

Andrey,
It looks like FFW is using default jvm encoding (see [1])

[1]: https://github.com/undera/jmeter-plugins/blob/55813f7d00a11c4f66dc59cbb9eb63d82aaa0415/standard/src/kg/apc/jmeter/reporters/FlexibleFileWriter.java#L334

Vladimir

Andrey Pokhilko

unread,
Jul 24, 2015, 9:42:05 AM7/24/15
to jmeter-plugins, sitnikov...@gmail.com, sitnikov...@gmail.com
Yeah, that might cause the issue. I've committed the change to use JMeter's encoding, please try using the developer snapshot from 24th of July and let us know if it helps.

--
Andrey

пятница, 24 июля 2015 г., 2:09:18 UTC+3 пользователь Vladimir Sitnikov написал:
Reply all
Reply to author
Forward
0 new messages