Cannot update data when data in ID field is non-ascii

I encounter a problem when trying to update data using Form, Connector, and DataProcessor.
I set up the page very similar to this tutorial … htmlxstart

The page update data without any problem if the ID field is an ASCII character. But, the problem occurs when the ID field is a non-ASCII character (in Thai).

The content of the connector php file is:

$formConn = new FormConnector($res,"MySQL");

It doesn’t matter if I use the render_table() or render_sql(). The results are the same.

I captured the POST request issued after the dpf.sendData() is invoked. The POST requests are:

  1. If the ID field is an ASCII character, the POST request is:
    S_!nativeeditor_status: updated
    S_VATrate: 0.1
    S_companyName: [some data in Thai]
    S_idCompany: S
    S_shortName: [some data in Thai]
    ids: S
  1. If the ID field is a non-ASCII character, the POST request is:
    _!nativeeditor_status: updated
    _VATrate: 0.1
    _companyName: [some data in Thai]
    _idCompany: ห (This is the correct ID character)
    _shortName: [some data in Thai]
    ids: [nothing here]

I’ve spend hours digging into the dataprocessor.php and other files and changed some code. But, I don’t have any luck getting it to work. Please help.

Try to update dataprocessor.js with the attached one
If it still doesn’t work - please provide any kind of sample where problem can be checked. (4.98 KB)

Thank you for the updated file. I tried with the attached files. The results are the same with the official release. I also unable to ‘update’ any recode if the data in the ID field contain any non-ascii character.

Please use ‘data.sql’ to create the testing database. (849 KB)

I think I found a solution.
The problem come from the match() function on the line 2481 in dhtmlxform.js. The line is in dhtmlxAjax.get inside the dhtmlxForm.prototype.load function.

The lines are:

var id = url.match(/(\?|\&)id\=([a-z0-9_]*)/i); if (id && id[0]) id = id[0].split("=")[1];
The url variable is given as “xml/company_details.php?id=ซ”

After these three lines, the id variable should be id=[“ซ”]. But, because the match function, the id = [""]. It solve my problem when I modified RegExp in the match() to match(/(?|&)id=([a-z0-9ก-๛_]*)/i). The additional characters only work for Thai language only. You will need to modify the RegExp for other language as well.

Problem confirmed, we will update code in next version to resolve such kind of problems.