Updating Problem

Hi,

I need your help.

I use a grid and a java-connector.
Loading data from Oracle is OK.
but After updating, some data(Korean column) were converted wrong.

Before Updating


After Updating

Why?
I tried to use set_config function. but it didn’t work.

java file is like this

Connection conn= ( new DBConnection()).getConnection();
GridConnector c = new GridConnector(conn, DBType.Oracle);
c.servlet(req, res);
c.dynamic_loading(100);

//c.set_encoding(“euc-kr”); //utf-8, euc-kr, ksc5601, iso-8859-1
c.render_table(“SB_ETC_CODE”, “CODE”, “DAEDIVI,JUNGDIVI,NAME,ETC”);

Any idea what I should look for?
Thank you for any help.

Hi,

You need to use the same encoding for the data as encoding of client side page, and set_encoding before render command, as in the above snippet.

If it still doesn’t work, try to add the next line to the client-side code

dp.enableUTFencoding(false);

where dp, instance of a dataprocessor, attached to the grid.

Thanks but it doesn’t work.

I use a “UTF-8” in client and server.

client file(html) is like this

... var dpg = new dataProcessor("/contact_manager/Etc_code_grid01_sel_1"); dpg.init(contactsGrid); //dpg.enableUTFencoding(false);

contactForm.attachEvent(“onButtonClick”, function(id){
alert(contactForm.getItemValue(“ETC”)); //–> (1)
contactForm.save();
alert(“After”+contactForm.getItemValue(“ETC”)); //–> (2)
});

In (1),(2) alert dialog, data is expressed rightly

but in log file and in db, it seems to be converted wrong.





I can’t find the reason.
Thank you for any help.

Please try to enable log for server side connector, and check the text of SQL queries. If data is correctly encoded there, problem must be in Oracle driver or DB configuration.

To enable log, check docs.dhtmlx.com/connector__java__errors.html

Thanks for reply.

I have already enabled log for server side.
and data isn’t correctly encoded there as already displayed.

In Toad, Updating the same table’s column is OK

Pls give some advices. Thanks.

Assuming that both client side and server side pages are using the same encoding. The only point which can add the error is the data escaping function

[code]//use non-utf data escaping
dp.enableUTFencoding(false);

//use utf data escaping
dp.enableUTFencoding(true);[/code]

As last resort, try to locate the next line in the dhtmlx.js

setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

and replace it with the next

setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");

Wow!!!
At last, it works correctly.

Thanks very much!!