/**** * * Gilad Lotan, UTF8 HTTP connection, Nov. 12th, 2006 * *****/ hcon = ( HttpConnection )Connector.open( url ); dis = new DataInputStream( hcon.openInputStream() ); InputStreamReader isr = new InputStreamReader(dis, "UTF8"); // retrieve the response from the server int ch; while ( ( ch = isr.read()) != -1 ) { responseWebpage.append( (char) ch ); }