Java servlets didnt work properly :(

Hi, now im working in linux system
based on ubuntu + mysql + tomcat6 blahblah~~
anyway, i got some problem.
my linux server is working properly in utf8 multi-language(ex. korean)
but, when i try to use dhtmlx component, then all character broken down…
like this ㅂㅈㄷ(korean language)
let me know how to fix it please… :frowning:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<script src="./dhtmlx_std_full/dhtmlx.js" type="text/javascript" charset="utf-8"></script>

	<script src="./connector.js" type="text/javascript" charset="utf-8"></script>

	<script src="./dhtmlx_std_full/dhtmlxdataprocessor.js" charset="utf-8"></script>

	<script src="./dhtmlx_std_full/dhtmlxdataprocessor_debug.js" charset="utf-8"></script>

	<link rel="stylesheet" href="./dhtmlx_std_full/dhtmlx.css" type="text/css" charset="utf-8">

	<div id="gridbox" width="350px" height="550px" style="background-color:white;overflow:hidden"></div>

</head>

<body>

<script>

	var mygrid = new dhtmlXGridObject('gridbox');

	mygrid.setImagePath("./dhtmlx_std_full/imgs/");

	mygrid.setHeader("Column A, Column B, Column C");

	mygrid.attachHeader("#connector_text_filter,#connector_text_filter,#connector_text_filter")

	mygrid.setInitWidths("100,100,*")

	mygrid.setColTypes("ed,ed,ed");

	mygrid.setColSorting("connector,connector,connector")

	mygrid.enableMultiselect(true)

	mygrid.init();

	mygrid.loadXML("../servlet/GameConnector");

	var dp = new dataProcessor("../test/servlet/GameConnector");

	dp.init(mygrid);

	dp.setUpdateMode("off");

	dp.enableUTFencoding(true);

</script>

<input type="button" name="add" value="add row" onclick="var id=mygrid.uid();mygrid.addRow(id,'',0); mygrid.showRow(id);">

<input type="button" name="delete" value="delete row" onclick="mygrid.deleteSelectedRows()">

<input type="button" name="commit" value="commit data" onclick="dp.sendData();">

</body>

</html>

[code]import java.sql.;
import javax.servlet.
;
import javax.servlet.http.;
import java.io.
;
import com.dhtmlx.connector.*;

public class GameConnector extends ConnectorServlet {
protected void configure() {
Connection conn=null;
try{
String driver=“org.gjt.mm.mysql.Driver”;
String url=“jdbc:mysql://localhost:3306/mydb?characterEncoding=utf8”;
Class.forName(driver).newInstance();
conn=DriverManager.getConnection(url, “root”, “”);
} catch(Throwable e) {
e.printStackTrace();
}
GridConnector c = new GridConnector(conn, DBType.MySQL);
c.render_table(“Player”, “idPlayer”,“playerName,playerType,playerScore”);
}
}
[/code]

Is problem occurs during data loading, or after saving changed data from the grid?

thank you for your concern!
in the client, data loding is very good
but when i fix somthing and then i send all changed data(dp.sendData()),
all korean string data saved with wrong format…
any utf8 servlets are working properly on mysql and tomcat6
i guess i miss some configuration for dhtmlx components

Try to update dhtmlxcommon.js with the attached one.
The problem can be in server configuration, which requires encoding header for all operations.
dhtmlxcommon_utf.zip (7.4 KB)

thank for your answer! i have solved the problem :laughing:
in the standard grid javascript(js) file code,
there is no charset definition…

original code :
this.xmlDoc.setRequestHeader(‘Content-type’, ‘application/x-www-form-urlencoded’);

changed code :
this.xmlDoc.setRequestHeader(‘Content-type’, ‘application/x-www-form-urlencoded; charset=utf-8’);

that’s all!!
anyway i appreciate your concern!