Author Topic: more unicode issues, now with ajax  (Read 4212 times)

qmax

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 0
  • Asterisk-11.7.0-ubuntu, Queuemetrics-15.10.1-tgz
    • View Profile
    • Email
more unicode issues, now with ajax
« on: November 12, 2009, 13:25:45 »
in 1.5.5
ajax pages reloaded in wrong encoding

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: more unicode issues, now with ajax
« Reply #1 on: November 13, 2009, 09:04:47 »
Can you post a screenshot? which browser do you use?

We track this as issue #926.

qmax

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 0
  • Asterisk-11.7.0-ubuntu, Queuemetrics-15.10.1-tgz
    • View Profile
    • Email
Re: more unicode issues, now with ajax
« Reply #2 on: November 13, 2009, 12:02:48 »
I guess, the following is better then screenshots.

ajax request/response (after redirecting from tpf?TPF_VERBO=qm_realtime2_ds
):

http://astra:8080/queuemetrics/qm/realtime2_datasource_frame.jsp


GET /queuemetrics/qm/realtime2_datasource_frame.jsp HTTP/1.1
Host: astra:8080
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko/2009060214 Firefox/3.0.11
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=04D8A73784D83B4D05238676E34DA204; ari_auth=a%3A2%3A%7Bi%3A0%3Bs%3A108%3A%22%2FEyKeHgw1TkwqcsuGoz4358U9h%2BGob8EkfqbC2q8uIN3YitVb0rNFBI7l8G4%2F0QcsGQmJslbpEvhkYLnEkHnW0eTFZjAZmSrp5LirgcJcVI%3D%22%3Bi%3A1%3Bs%3A32%3A%22c3286eaf80e6919d8c98d1f64f14ce49%22%3B%7D

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Expires: Tue, 01 Jan 2002 00:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 4539
Date: Fri, 13 Nov 2009 10:52:56 GMT

Content fragment (markup stripped):
Code: [Select]
{ "tab_riepilogo": '\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n\n \n \n \n \n \n \n \n \n \n \n\n
  ???????  ? ?????? ????? ???????? ?? ????? ?? ???????? ????? ? ?????????? ?????? ???????? ?????????
all selected 0 0 0 0 0 0 0 0
\n\n\n
  ?????????????? ???... [\'Spreadsheet\'] [\'CSV\'] [\'XML\']
', "tab_chiamate": '\n\n\n\n\n \n \n \n \n \n \n \n \n \n\n\n
  ???????  ??????????  ????????  ?????????  ????????????  ?????  ??????
\n\n\n
  ?????????????? ???... [\'Spreadsheet\'] [\'CSV\'] [\'XML\']
', "tab_agenti": '\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n\n\n
  ?????  ????????? ????  ???????: ?????. ?????  ?? ?????  ?????? ????????? ?????? ?? ???????
\n\n\n
  ?????????????? ???... [\'Spreadsheet\'] [\'CSV\'] [\'XML\']
', "errormsg": '', "dataOra": '16:52:56' }
These are question marks chars in place of table labels.
« Last Edit: November 13, 2009, 12:07:59 by qmax »

qmax

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 0
  • Asterisk-11.7.0-ubuntu, Queuemetrics-15.10.1-tgz
    • View Profile
    • Email
Re: more unicode issues, now with ajax
« Reply #3 on: November 13, 2009, 12:38:32 »
Very Hot Fix:
added
Code: [Select]
<%@page contentType="text/plain; charset=UTF-8"%>
in files:
qm/realtime2_datasource_frame.jsp and qm/wallboard_00_datasource_frame.jsp

I am by no means a JSP programmer, and not sure it is right way to fix the headers.
But it works now.

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: more unicode issues, now with ajax
« Reply #4 on: November 13, 2009, 17:41:21 »
Yes we fixed it along these lines before seeing your solution.

In the file qm/realtime2_datasource_frame.jsp, just add the lines:
Code: [Select]
<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>

after the line that says:
Code: [Select]
<%@ page import="java.text.*" %>
We will be releasing a new official build next week that will address the problem....


qmax

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 0
  • Asterisk-11.7.0-ubuntu, Queuemetrics-15.10.1-tgz
    • View Profile
    • Email
Re: more unicode issues, now with ajax
« Reply #5 on: November 16, 2009, 11:59:09 »
Hm.
This particular pages return json-serialized data (with embedded html),
shouldn't it be text/plain ? (or application/json as standards recommend)
or it doesn't matter?
« Last Edit: November 16, 2009, 13:52:25 by qmax »

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: more unicode issues, now with ajax
« Reply #6 on: November 16, 2009, 14:55:07 »
I think the browser will not care much.... I think it should be application/json anyway.