Why am I getting diamonds with ? for German chars?
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Why am I getting diamonds with ? for German chars?
I have upgraded to XAMPP Control Pane v3.2.1, and now all sites that have words such as " Zubehör ", the ö is getting that character up. But it doesn't show LIVE, nor did it show on m prev version of XAMPP.
Any help?
Simon
Any help?
Simon
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Why am I getting diamonds with ? for German chars?
It probably means the old word was using the ISO 8859-1 encoding ("latin1") while the new XAMPP is using UTF-8.
Were there any sorts of upgrade scripts you needed to run? Where are these words coming from?
Were there any sorts of upgrade scripts you needed to run? Where are these words coming from?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
The words are entered both manually and via DB.
Do I need to alter XAMPP?
Do I need to alter XAMPP?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Why am I getting diamonds with ? for German chars?
What versions of PHP did you upgrade from and to? And what does
output? And what's your code to connect to the database?
Code: Select all
SHOW CREATE TABLE whatever_database_table_those_words_are_coming_from-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
The code to connect to the database remains unchanged, and using PDO.
I'm not sure what version of PHP I was on.But I am now on:
PHP Version 5.6.8
I'm not sure what version of PHP I was on.But I am now on:
PHP Version 5.6.8
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
[text]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">[/text]
This is what's at the top. Maybe that is wrong?
It works Live, and on the previous PHP version.
<html xmlns="http://www.w3.org/1999/xhtml">[/text]
This is what's at the top. Maybe that is wrong?
It works Live, and on the previous PHP version.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Why am I getting diamonds with ? for German chars?
PHP 5.6 changed the default encoding for some things to UTF-8. You should be using that. However until you can change your code to do that, find the default_encoding INI setting and set that to iso-8859-1. And restart.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
Where do you find that code? I searched for that term in php.ini. not in there.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Why am I getting diamonds with ? for German chars?
Oh, I had the wrong name for it. How about you look through the php.ini for a setting that looks appropriate?
Re: Why am I getting diamonds with ? for German chars?
Dunno if this helps but im using
(had the same problem with Swedish chars after an update. Above code fixed it for me anyway....
Code: Select all
if (!$mysqli->set_charset("utf8")) { //can put error handling here}
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
Thanks. What do you mean "can put error handing here"?
Do I literally wrap this code around the whole template??
Do I literally wrap this code around the whole template??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Why am I getting diamonds with ? for German chars?
Did requinix' suggestion not work?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
I would not know what "setting" to look for.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Why am I getting diamonds with ? for German chars?
Code: Select all
if (!$mysqli->set_charset("utf8")) { // Har gor jag sa man kan skriva åäö i databasen.
printf("Error loading character set utf8: %s\n", $mysqli->error);
$SidText=$SidText."Vi har inte lyckats upprätta en UTF8 (Svenskt teckenuppsättning) anslutning med servern.\n";
printf(" Error loading character set utf8: %s\n", $mysqli->error);
//} else {
printf("Current character set: %s\n", $mysqli->character_set_name());
$SidText=$SidText."Servern är mottaglig för UTF8 (Svensk teckenuppsättning) textformat.\n";
printf("Current character set: %s\n", $mysqli->character_set_name());
}
Hope it helps.. I got really tired of those wierd signs to replace åäö
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Why am I getting diamonds with ? for German chars?
I'm also getting them for € and $ and £.
All because I have the latest version of xampp. Maybe I should uninstall it and reinstall!
Would that uninstall all my sql databases?
All because I have the latest version of xampp. Maybe I should uninstall it and reinstall!
Would that uninstall all my sql databases?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.