Wrong charset for the json response

2,002 views
Skip to first unread message

Alexey Kochetov

unread,
Jul 23, 2013, 1:25:22 AM7/23/13
to jmeter-...@googlegroups.com
Hi, I'm using JSON Path Assertion, JSON Format Post Processor and JSON Path Extractor elements to parse the json response but it contains foreign symbols (russian) and it displays in Jmeter like this:

{
    "status": 0,
    "response": [    {
        "id": "123456789",
        "login": "xxxxxxxxxxxxxx",
        "email": "xxxx...@xxxxxxxxxx.ru",
        "system": "portal",
        "firstName": "à  à »à µà ºÑ à µà ¹",
        "middleName": "à ’à °Ñ à ¸à »ÑŒà µà ²à ¸Ñ‡",
        "lastName": "à šà ¾Ñ‡à µÑ‚à ¾à ²"
    }]
}

I understand that it's not the jmeter-plugins problem, but I believe that you have the quick decision of this problem. Thank u in advance!

Andrey Pohilko

unread,
Jul 23, 2013, 6:23:09 AM7/23/13
to jmeter-...@googlegroups.com
Take a look at this article: http://stackoverflow.com/questions/8488811/jmeter-sample-response-encoding
The only way to change something encoding-related in JMeter is sample encoding property.

вторник, 23 июля 2013 г., 9:25:22 UTC+4 пользователь Alexey Kochetov написал:
Message has been deleted
Message has been deleted

Andrey Pohilko

unread,
Jul 24, 2013, 7:32:02 AM7/24/13
to jmeter-...@googlegroups.com
The message was eaten by google spam filter:
"Hi, Andrey.

Please look here http://stackoverflow.com/questions/17801836/wrong-encoding-in-json-response-jmeter/17826297?noredirect=1#17826297

The problem is solved for the last nighty build but I can't use there the samples like JSON Format Post Processor, JSON Path Assertion, etc because of 2013/07/24 14:14:08 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException.

The jmeter-plugins don't support the nighty builds? What should I do in this case? Thank you."

вторник, 23 июля 2013 г., 9:25:22 UTC+4 пользователь Alexey Kochetov написал:
Hi, I'm using JSON Path Assertion, JSON Format Post Processor and JSON Path Extractor elements to parse the json response but it contains foreign symbols (russian) and it displays in Jmeter like this:

Andrey Pohilko

unread,
Jul 24, 2013, 7:34:04 AM7/24/13
to jmeter-...@googlegroups.com
It seems you should reinstall Jmeter plugins for nightly build, it misses commons-lang JAR in lib folder.

среда, 24 июля 2013 г., 15:32:02 UTC+4 пользователь Andrey Pohilko написал:

Alexey Kochetov

unread,
Jul 24, 2013, 8:27:17 AM7/24/13
to jmeter-...@googlegroups.com

Andrey, it seems that I found a bug:

Thread Group
|
-- JSON Format Post Processor
|
-- Simple Controller
   |
   --Json Request
     |
     --Json Path Extractor
     |
     --BSF PostProcessor ( prev.setDataEncoding("UTF-8") )


When JSON Format Post Processor is active - I have the json response like:

        "attributes":         [
                        {
                "id": "ADDRESS",
                "value": "Ð‘Ð°Ð³Ñ€Ð°Ñ‚Ð¸Ð¾Ð½Ð¾Ð²Ñ ÐºÐ¸Ð¹ пр., дом 16 Ñ Ñ‚Ñ€. 14"
            },


when it is turned off - the situation is much better

"attributes":[{"id":"ADDRESS","value":"Багратионовский пр., дом 16 стр. 14"},

Any ideas?

среда, 24 июля 2013 г., 15:34:04 UTC+4 пользователь Andrey Pohilko написал:

Andrey Pohilko

unread,
Jul 24, 2013, 8:33:36 AM7/24/13
to jmeter-...@googlegroups.com
The source code for the formatter is quite simpe. If you're familiar with Java, you can get the sources and make some experiments, modifying the source: https://github.com/undera/jmeter-plugins/blob/master/extraslibs/src/com/atlantbh/jmeter/plugins/jsonutils/jsonformatter/JSONFormatter.java

среда, 24 июля 2013 г., 16:27:17 UTC+4 пользователь Alexey Kochetov написал:

Alexey Kochetov

unread,
Jul 24, 2013, 8:39:57 AM7/24/13
to jmeter-...@googlegroups.com
Unfortunately I am not familiar with Java. Anyway something is wrong here - maybe someone can solve it. Thank you! Now I try not to use this Sampler - maybe I can localize the problem during my future job.

среда, 24 июля 2013 г., 16:33:36 UTC+4 пользователь Andrey Pohilko написал:
Reply all
Reply to author
Forward
0 new messages