Click to See Complete Forum and Search --> : utf8


zebdaag
02-20-2007, 09:27 AM
Hi i having some problem with substracting information from my database:
I have in my database the word: Scandinavië

This is substracted from the database but it is converted to utf8 so this is what it looks like:
$row["land"] = Scandinavië

Then i have an if funtion like this:
$selected = Scandinavië;
if($row["land"] == $selected){
echo "this doesn't work";
}

That didn't work that's why i tried this:
$selected = Scandinavië;
if($row["land"] == utf8_decode($selected)){
echo "this works on safari and firefox doesn't work on IE";
}

This works on Safari and Firefox on the mac but it doesn't work on IE6
Is there a way to convert one or both variables so they match in al browsers??

canha
02-25-2007, 06:46 AM
Did you try decoding the $row["land"] into utf8 also?


$land_decoded = utf8_decode($row["land"]);
if ($land_decoded == utf8_decode($selected)) {
echo "not tested";
}


I haven't tested this.
But I don't see why it wouldn't work.

Let me know how it goes.

mahfooz
02-26-2007, 06:42 AM
you might try this

$selected = "Scandinavië";

and then proceede to if statement

canha
02-26-2007, 10:27 AM
Oh yeah. You forgot about the quotes.

I ALWAYS forget quotes.