jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Encoded UTF16 json response
Date Mon, 09 Mar 2009 00:54:42 GMT
On 05/03/2009, sebb <sebbaz@gmail.com> wrote:
> On 05/03/2009, Troy Harris <troy.harris.oz@gmail.com> wrote:
>  > 2009/3/5 sebb <sebbaz@gmail.com>
>  >
>  >  > On 05/03/2009, Troy Harris <troy.harris.oz@gmail.com> wrote:
>  >  > > 2009/3/5 sebb <sebbaz@gmail.com>
>  >  > >
>  >  > >
>  >  > >  > On 02/03/2009, Troy Harris <troy.harris.oz@gmail.com> wrote:
>  >  > >  > > Hi,
>  >  > >  > >
>  >  > >  > >  Im having trouble viewing a Response which is chunked UTF-16.
View
>  >  > >  > results
>  >  > >  > >  tree displays encoded text which I cant use.
>  >  > >  >
>  >  > >  > I doubt that the chunking makes any difference.
>  >  > >  >
>  >  > >  > JMeter uses Java HTML document to display the response. I don't
know
>  >  > >  > if it can handle UTF-16.
>  >  > >  >
>  >  > >  > >  If I Save Response to a file it appears as
>  >  > >  > >  expected in notepad (notepad++ displays NUL after
>  >  > >  > >  each character).
>  >  > >  >
>  >  > >  > That's not proof that the contents are OK - do you not have an
>  >  > >  > application that can display the data properly?
>  >  > >  >
>  >  > >
>  >  > >
>  >  > > Yes, the browser - FF/IE7. Once this page hits the browser the jqGrid
>  >  > loads
>  >  > >  with data.
>  >  > >
>  >  >
>  >  > So does it display correctly if the browser uses the copy downloaded
>  >  > using "Save Response to a file"?
>  >  >
>  >
>  >
>  > The downloaded copy saves as "response.json" which the jqGrid AJAX uses to
>  >  generate
>  >  the grid.
>  >
>  >
>  >  >
>  >  > You may need to save the HTML page and edit it to retrieve the data
>  >  > locally.
>  >  >
>  >
>  >
>  > Not a lot of time to attempt this at the moment. But next allocated round I
>  >  could
>  >  give it a try.
>
>
> No point, given that the local file is processed OK. I assumed that it
>  might be necessary to tweak the HTML to do so but it seems not.
>
>
>  >
>  >  >
>  >  > This would show if the data is downloaded OK, i.e. the problem is
>  >  > purely that the Tree View Listener cannot handle UTF-16.
>  >  >
>  >  > By the way, which Response Data pane option were you using?
>  >  >
>  >  > Show Text/Render HTML/Render XML/Render JSON ?
>  >  >
>  >  > Do some work and not others?
>  >  >
>  >
>  > > They all display the same content except for Render XML.
>  >
>  >  The reponse displayed via View Results tree
>  >  http://img15.imageshack.us/img15/6953/jmeterutf16response.jpg
>  >
>
>
> I see - not very useful...
>
>  Would you be able to send me (privately) one of the json files?
>

Thanks for the file.

It looks like the problem is that the charset is wrong - as far as I
can tell, the data is encoded in UTF-16LE and there is no BOM (byte
order mark), yet the charset is UTF-16.

This means that the code cannot tell if the data is LE (little-endian)
or BE (big-endian), so it does not interpret UTF-16 correctly.

If the server is fixed to send the charset UTF-16LE (or add the
appropriate BOM) then you should find that the display looks OK.

>  >
>  >  >
>  >  > >
>  >  > >  > >  Am I missing a config option to allow the UTF-16 reponse
to be
>  >  > >  > displayed?
>  >  > >  >
>  >  > >  > No.
>  >  > >  >
>  >  > >  > >  Should I be able to extract a variable out of the saved
file even
>  >  > though
>  >  > >  > its
>  >  > >  > >  UTF-16?
>  >  > >  >
>  >  > >  > No, you cannot extract variables out of saved files - UTF-16 or
>  >  > otherwise.
>  >  > >  >
>  >  > >  > However, you should be able to extract variables out of the response
>  >  > data.
>  >  > >  >
>  >  > >  > >
>  >  > >  > >  Response headers:
>  >  > >  > >  HTTP/1.1 200 OK
>  >  > >  > >  Cache-Control: private
>  >  > >  > >  Transfer-Encoding: chunked
>  >  > >  > >  Content-Type: application/json; charset=utf-16
>  >  > >  > >  Server: Microsoft-IIS/7.0
>  >  > >  > >  X-AspNet-Version: 2.0.50727
>  >  > >  > >  Set-Cookie:
>  >  > >  > >
>  >  > >  >
>  >  >  SecurityToken=etlwabVmCrGZDZU0Ix+Re1oUhBmHlZFQDDKrVO68Pd5tdqT2HgkEEyaiBR2UyKiL;
>  >  > >  > >  expires=Mon, 02-Mar-2009 05:55:06 GMT; path=/
>  >  > >  > >  X-Powered-By: ASP.NET
>  >  > >  > >  Date: Mon, 02 Mar 2009 05:35:05 GMT
>  >  > >  > >
>  >  > >  > >
>  >  > >  > >
>  >  > >  > >  Thanks for your help.
>  >  > >  >
>  >  > >  > Is there a publically accessible page that returns data encoded
in
>  >  > this
>  >  > >  > way?
>  >  > >  >
>  >  > >
>  >  > >
>  >  > > Not at the moment, software is in development stage.
>  >  > >
>  >  > >
>  >  > >  >
>  >  > >  > Does JMeter work OK for you if the encoding is set to UTF-8 (assuming
>  >  > >  > that there are such pages on the server under test)?
>  >  > >  >
>  >  > >
>  >  > >
>  >  > > I have the Developers changing the reponse to UTF-8 in the next build
so
>  >  > >  hopefully
>  >  > >  the issue wont occur. I'll update the post then.
>  >  >
>  >  > OK, unless the pages really need UTF-16 it is probably better to use
>  >  > UTF-8 as the pages will usually be somewhat smaller.
>  >  >
>  >  > >  Thanks for your help Seb
>  >  > >
>  >  > >
>  >  > >
>  >  > >  >
>  >  > >  > >  Troy
>  >  > >  > >
>  >  > >  > >
>  >  > >  > >  --
>  >  > >  > >  NOTICE:
>  >  > >  > >  This e-mail message is intended only for the addressee(s)
and
>  >  > contains
>  >  > >  > >  information which may be confidential. If you are not the
intended
>  >  > >  > recipient
>  >  > >  > >  please advise the sender by return email, do not use or
disclose
>  >  > the
>  >  > >  > >  contents, and delete the message and any attachments from
your
>  >  > system.
>  >  > >  > >
>  >  > >  >
>  >  > >
>  >  > > > ---------------------------------------------------------------------
>  >  > >  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  > >  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >  > >  >
>  >  > >  >
>  >  > >
>  >  > >
>  >  > >
>  >  > >  --
>  >  > >
>  >  > > NOTICE:
>  >  > >  This e-mail message is intended only for the addressee(s) and contains
>  >  > >  information which may be confidential. If you are not the intended
>  >  > recipient
>  >  > >  please advise the sender by return email, do not use or disclose the
>  >  > >  contents, and delete the message and any attachments from your system.
>  >  > >
>  >  >
>  >  > ---------------------------------------------------------------------
>  >  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >  >
>  >  >
>  >
>  >
>  >  --
>  >  NOTICE:
>  >  This e-mail message is intended only for the addressee(s) and contains
>  >  information which may be confidential. If you are not the intended recipient
>  >  please advise the sender by return email, do not use or disclose the
>  >  contents, and delete the message and any attachments from your system.
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message