PDA

View Full Version : Swedish Font Problems ÄÅÖ



VoS
May 23rd, 2005, 02:24 PM
Hey!
im using a form i made in flash to send variables to a MySql Database.
code for form:

//trace(email1.text+", "+question1.text+", "+check1.selected);
status1.text
send1.onPress = function () {
status1.text = "sending..";
var ld:LoadVars = new LoadVars ();
var reciever:LoadVars = new LoadVars();
ld.email1 = email1.text;
ld.question1 = question1.text;
ld.public1 = check1.selected;
trace (ld);
ld.sendAndLoad ('http://www.valj.nu/live/script/ny.php', reciever, 'POST');
reciever.onLoad = function () {


trace("Recieved info -> "+reciever);
status1.text = "Sent!";

};
};

Its sends it perfectly well to the databse thru this page:


<?
include("dbconnect.php");
$email = $_POST['email1'];
$question = $_POST['question1'];
$public = $_POST['public1'];
$question = stripslashes($question);
$email = stripslashes($email);
$sql = mysql_query("INSERT INTO nya (email , fråga , datum , publiceras)
VALUES('$email', '$question', now(),'$public')")
or die (mysql_error());
?>

however in the database if i have used the swedish letters ÄÅÖ äåö
it looks like this:

"hejsan
jag Heter VoS
Jag Är från Sverige
Öland..."

this is just a text i typed in one of the fields, its supposed to look like this:
"hejsan
jag heter VoS
Jag Är från Sverige
Å öland"

anyone abel to tell my why, and more importantly how i fix it?

thanks


//VoS

glkngs
May 23rd, 2005, 05:00 PM
Did you remember to put System.useCodepage = true in your movie?

VoS
May 23rd, 2005, 05:47 PM
that was 1st thing i tried but it resulted in an error
dident say what the error was , just that there was one

glkngs
May 23rd, 2005, 06:11 PM
Well, it shouldn't!
Copy the line i wrote above and paste it in the scriptpane.

:)

ditti
May 23rd, 2005, 07:07 PM
I have had problems with swedich carachters. It was solved by when saving textfiles chosing: Encoding UTF-8.

glkngs
May 24th, 2005, 05:55 AM
I have had problems with swedich carachters. It was solved by when saving textfiles chosing: Encoding UTF-8.

That's a great tip, but it looks as if Vos is saving the data to a database ;)

VoS
May 24th, 2005, 06:17 AM
Hey , got it fixxed now...
for some reason it works if i have the use coda page thingy twice, but not if i just have it once , weird huh?

glkngs
May 24th, 2005, 06:51 AM
That is wierd? Are you sure that the two lines are exactly the same - with case and all?

VoS
May 24th, 2005, 08:23 AM
That is wierd? Are you sure that the two lines are exactly the same - with case and all?

yeah , outof frustration i was cutting and pasting it over and over again , and hit cntrl enter and it worked , then i started removing em , and works with as low as 2 lines, as identical as copy and paste can get

glkngs
May 24th, 2005, 08:43 AM
allright then, you get me :h: