Encoding issue using SchedulerConnector in Java

Hi,

I try to use SchedulerConnector in our java webserver with this code:

ArrayList<Object> array = new ArrayList<Object>();

SchedulerItem item = new SchedulerItem( );
item.Id = 1378797181945000011;
item.Start = "2013-09-10 10:30";
item.End = "2013-09-10 11:30";
item.Text = "æ";
array.add( item );

SchedulerConnector data = new SchedulerConnector( null );
data.servlet( request, response ); 
data.set_encoding( "UTF-8" );
data.render_array( array, "Id", "Start, End, Text" );

I am fetching the data using this javascript:


function newXMLHttpRequest(){
	var xmlreq = false;
	if ( window.XMLHttpRequest ){
		xmlreq = new XMLHttpRequest();
	}
	else if ( window.ActiveXObject ){
   		// Try ActiveX
		try 
		{ 
			xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e1)
		{ 
			// first method failed 
			try
			{
				xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch ( e2 )
			{
				alert( 'Exception e2: ' + e2 );
			} 
		}
 	}
	else	{
		alert( 'Unknown Browser Type' );
	}
  return xmlreq;
} 


function getText( url, content )
{
  var request = newXMLHttpRequest();     
  request.open( "POST", url, false );
  request.setRequestHeader( "Content-Type", "text/plain;charset=UTF-8" );
  try {
    request.send( content );
  } catch (e) {
    alert('Unable to connect to server');
    exit;
  }
  console.log(request.responseText)
  return request.responseText;                                         
}


function refresh(date)
{
  scheduler.clearAll(); 
  
  // I am loading the scheduler data with our own functions 
  var s = getText("servlet/scheduler/data?date="+dateToString(date)+"&view="+currentview);
  scheduler.parse(s);
}

You can see the result in the attachement. You can see the scheduler show a black diamond with a question-sign
I am using UTF-8 everywhere. What am I doing wrong?

Thanks.


main html page - is it shown with utf encoding as well ?

Greetings,

I had a very similar issue, got it fixed by adding:

response.setCharacterEncoding(“UTF-8”);

before

data.render_array( array, “Id”, “Start, End, Text” );

Hope it helps.
Bertrand