[Dojo-interest] FormBind with german Umlauts
nicolo
nicolo at corniecuador.com
Mon Feb 26 08:26:57 MST 2007
Hi Christian,
I have the same problem. Everytime I send data using dojo.io.bind, my server
application (apache and php) has to encode the input variables like this:
$id = utf8_encode($_POST['u_id']);
If I do not do this, PHP will not recognize spanish characters like ñ, Ñ,
á, é, etc
It seems to me thata this behavior is not related to dojo.io.* because I
have used other libraries like sajax and I have gotten the same results:
data arrives in ISO-8859 when submiting via AJAX.
So, In order to solve this problem I send the data to the Server ina normal
dojo.io way, but I utf8_encode the arriving data in the Server for instance:
JAVASCRIPT:
var objParams = {
modulo: 'usuario',
accion: 'get',
nombre: dojo.byId('nombre').value
}
var kw = {
url: 'test.php',
mimetype: "text/json",
method:"post",
content: objParams,
load: function(type, json, http) {
/* bla bbla bla */
}
};
dojo.io.bind(kw);
SERVER:
$persona_nombre = utf8_encode($_POST['nombre']);
I hope this helps you someway.
Regards,
IVAN MUELA
-----Mensaje original-----
De: dojo-interest-bounces at dojotoolkit.org
[mailto:dojo-interest-bounces at dojotoolkit.org] En nombre de Christian Thies
Enviado el: Lunes, 26 de Febrero de 2007 9:41
Para: Dojo-interest at dojotoolkit.org
Asunto: [Dojo-interest] FormBind with german Umlauts
Hi everybody,
following problem:
When submitting a form via "normal" browser-submit data arrives in UTF-8
- as wanted.
But when submitting same form via dojo.io.FormBind data arrives in
ISO-8859 :(
Any ideas?
--- code ---
x = new dojo.io.FormBind({
formNode: form,
load: function(type, data, evt) {
dojo.widget.byId("DialogContent").hide();
if(dojo.io.formHasFile(form))
display.setUrl(form.action);
else
display.setContent(data);
},
error: function( type, error, e ){
dojo.widget.byId("DialogContent").hide();
alert(type.toSource());
alert(error.toSource());
alert(e.toSource());
}
});
--- code ---
regards,
Christian
--
Anwendungsentwicklung
BLACKBIT interactive GmbH | BLACKBIT Viani GmbH
Ernst-Ruhstrat-Str. 6 - D-37079 Goettingen
tel.: +49-551-50675-50 - fax.: +49-551-50675-55
email: christian.thies at go-community.de
Klassische Werbung und Online-Marketing: http://www.blackbit.de
Software für Online-Marketing: http://www.go-community.de
_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest at dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest
________________________________________________________
Este email ha sido escaneado en busqueda de virus.
WWW.CLAMAV.NET
CORNI S.A
Departamento de Sistemas.
________________________________________________________
________________________________________________________
Este email ha sido escaneado en busqueda de virus.
WWW.CLAMAV.NET
CORNI S.A
Departamento de Sistemas.
________________________________________________________
More information about the Dojo-interest
mailing list