PDA

View Full Version : AS=>PHP=DataBase encoding problem



bmerens
April 1st, 2005, 07:22 AM
hello,

I have on my website a formular which sends its data to my database via a pho script.

everything works fine except for words like "ù à è é ...." french and german letters like ü ä....etc

I tried to encode the data with rawurlencode or utf8_encode but still the same prob, the database can't read the letters ü,é,à...etc

is it possible to encode the data within AS? it seems to me the only solution....or not? :ponder:


something else, I ha ve a php script which takes from my DB data containing letters like é,è...etc...and before sending it to AS I encode it with utf8_encode and this wokrs really fine.


any suggestions?

ghjr
April 1st, 2005, 07:35 AM
If you echo it in your PHP script (before inserting into the database) does it come out correctly?

bmerens
April 1st, 2005, 07:41 AM
I can add an echo to my php script, but the AS uses sendvar.sendAndLoad("http://www. to call the php script.

it doesn't open the php page. I cant't see the echoed variable

ghjr
April 1st, 2005, 08:06 AM
Maybe setting this on the PHP file header might help:
<meta http-equiv="content-type" content="text/html;charset=UTF-8">

I don't think performing htmlspecialchars() on the string before inserting would help out at all in this case (since I don't think those are considered html special characters), but you might give it a try.

Cheers!

Dutchy
April 1st, 2005, 08:20 AM
Have you tried:


system.useCodepage = true;

maybe that will help,
Dutchy

bmerens
April 1st, 2005, 01:55 PM
that's it

thanks a lot :) :) :)

bmerens
April 1st, 2005, 02:21 PM
but this solution brings a new problem :

my php script sends an automatic email, containing french and german characters, to the customer. before I switchen the UseCodePage to true , the email schowed the french and german characters properly

but now, as the UseCodePage is true, the automatic email doesn't recognize the french/german characters anymore.

what can I do now I dont' understand all these encoding problems hopless