Encoding

I need to submit this form to server using ISO-8859-1 character encoding.

myForm.send(’<?=$PHP_SELF;?>?option=save’, function(loader, response) {

});

“ESPAÑOL” is recieved as “ESPAÑOL” in server side

is there any way to do this?

just like a DataProcessor’s method “enableUTFencoding(false);”

thank you

Unfortunately it can’t be controlled by API
You can locate next line in code of dhtmlxForm.js

for (var key in formdata) data.push(key+"="+encodeURIComponent(formdata[key]));

and remove encodeURIComponent call

Hi, thank for your answer, but it doesn’t work

//for (var key in formdata) data.push(key+"="+encodeURIComponent(formdata[key]));
for (var key in formdata) data.push(key+"="+formdata[key]);

server still receiving “ESPAÑOL” instead “ESPAÑOL”
or “página” instead “página”

:neutral_face: any suggestion?

Hi
Please provide direct link

Hi …

link for a test

sicecloud.com/test/ciclos_test.php

Hello

  1. your page not have encoding at all (add meta)
  2. yes, “ESPAÑOL” go to server as “ESPAÑOL”

I can recommend you:

  1. switch to utf-8 encondg
  2. add meta charset=utf-8 to your pages
  3. add encondg=“utf-8” to xml

you can check our demo
dhtmlx.com/docs/products/dht … _init.html

just open, edit any booktitle (it will saved automaticaly)
reload page to see how it saved, I just tried and it works fine

Hi Andrei,

I think dhtmlxForm should have a method like “enableUTFencoding(false);” instead change all my project to utf

i will use a php function utf8_decode() for each variable in server

thank you.

:neutral_face:

well,

js have only encodeURIComponent (and 2 more like this one) which encode string for sending to server. it not changing encoding, just convert some chars into corresponding format, f.e. encodeURIComponent(“ESPAÑOL”) => “ESPA%C3%91OL”, but 1) some one removed this from form (line 3170 in your demo), 2) someone configured server incorrectly. as I already told - on our side it works fine. your page not have encoding at all, and my browser for example sending to server “ESPAÑOL” as “ESPAÑOL”. I added “for (var key in formdata) data.push(key+”="+encodeURIComponent(formdata[key])); " back and not it send correctly, but your script while building form writes: value: “ESPAÑOL”. so seems like problem on server side and partialy on client.