D
design4future
Hello
I've developed an PHPMYADMIN lookALike in AJAX,Perl,Mysql.
All owrks fine except the french, german special chars.
AJAX-Part:
At the moment i create an XMLhttpRequest-Object with
new XMLHttpRequest();
or
new ActiveXObject("Microsoft.XMLHTTP");
now the function opens the connection ...
obj.open("POST", URL);
then i add an HTTPheader with
obj.setRequestHeader("Content-Type","application/x-www-form-urlencoded;
charset=UTF-8");
now i call the send methode
obj.send(CGIVars);
The CGIVars are urlencoded with "encodeURIComponent"
thats the AJAX-Part
In Perl:
Now i fetch the Params with
CGI->param("postVarname");
and store them over DBI & DBD::mysql into the database.
This works fine too. It occurs no error.
But the output from chars like "äöü" in the database are corrupted.
They look like "ää".
I have check this with phpmyadmin
The
Where is the bug?
When i convert the values over encode_utf8() they are damaged too.
+ But I think they are already in UTF8 or not? Perl handles all
internal strings in UTF8 or not?
+ How can i check which encoding is used in Perl?
+ Is the Ajax-Header correct?
+ Javascript sends all the data via POST or GET in UTF8, or not?
SYSTEM-Information:
Windows XP SP1
Apache 1.3
Perl 5.8.0 Build 806
Mysql 4.1.18-nt (collation: utf8_unicode_ci)
DBI Version 1.48
DBD-mysql Version 3.00002
phpmyadmin 2.7.0-pl2
Checked with Firefox 1.5.01
Thanks for every suggestion.
best regards,
robert
I've developed an PHPMYADMIN lookALike in AJAX,Perl,Mysql.
All owrks fine except the french, german special chars.
AJAX-Part:
At the moment i create an XMLhttpRequest-Object with
new XMLHttpRequest();
or
new ActiveXObject("Microsoft.XMLHTTP");
now the function opens the connection ...
obj.open("POST", URL);
then i add an HTTPheader with
obj.setRequestHeader("Content-Type","application/x-www-form-urlencoded;
charset=UTF-8");
now i call the send methode
obj.send(CGIVars);
The CGIVars are urlencoded with "encodeURIComponent"
thats the AJAX-Part
In Perl:
Now i fetch the Params with
CGI->param("postVarname");
and store them over DBI & DBD::mysql into the database.
This works fine too. It occurs no error.
But the output from chars like "äöü" in the database are corrupted.
They look like "ää".
I have check this with phpmyadmin
The
Where is the bug?
When i convert the values over encode_utf8() they are damaged too.
+ But I think they are already in UTF8 or not? Perl handles all
internal strings in UTF8 or not?
+ How can i check which encoding is used in Perl?
+ Is the Ajax-Header correct?
+ Javascript sends all the data via POST or GET in UTF8, or not?
SYSTEM-Information:
Windows XP SP1
Apache 1.3
Perl 5.8.0 Build 806
Mysql 4.1.18-nt (collation: utf8_unicode_ci)
DBI Version 1.48
DBD-mysql Version 3.00002
phpmyadmin 2.7.0-pl2
Checked with Firefox 1.5.01
Thanks for every suggestion.
best regards,
robert