Page 1 of 2
Why am I getting diamonds with ? for German chars?
Posted: Fri Jun 26, 2015 8:37 am
by simonmlewis
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
Re: Why am I getting diamonds with ? for German chars?
Posted: Fri Jun 26, 2015 5:50 pm
by requinix
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?
Re: Why am I getting diamonds with ? for German chars?
Posted: Sat Jun 27, 2015 2:05 am
by simonmlewis
The words are entered both manually and via DB.
Do I need to alter XAMPP?
Re: Why am I getting diamonds with ? for German chars?
Posted: Sat Jun 27, 2015 7:13 am
by requinix
What versions of PHP did you upgrade from and to? And what does
Code: Select all
SHOW CREATE TABLE whatever_database_table_those_words_are_coming_from
output? And what's your code to connect to the database?
Re: Why am I getting diamonds with ? for German chars?
Posted: Mon Jun 29, 2015 3:02 am
by simonmlewis
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
Re: Why am I getting diamonds with ? for German chars?
Posted: Mon Jun 29, 2015 3:04 am
by simonmlewis
[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.
Re: Why am I getting diamonds with ? for German chars?
Posted: Mon Jun 29, 2015 4:14 pm
by requinix
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.
Re: Why am I getting diamonds with ? for German chars?
Posted: Tue Jun 30, 2015 2:13 am
by simonmlewis
Where do you find that code? I searched for that term in php.ini. not in there.
Re: Why am I getting diamonds with ? for German chars?
Posted: Tue Jun 30, 2015 3:51 am
by requinix
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?
Posted: Fri Jul 03, 2015 4:00 pm
by hybris
Dunno if this helps but im using
Code: Select all
if (!$mysqli->set_charset("utf8")) { //can put error handling here}
(had the same problem with Swedish chars after an update. Above code fixed it for me anyway....
Re: Why am I getting diamonds with ? for German chars?
Posted: Sat Jul 04, 2015 5:39 am
by simonmlewis
Thanks. What do you mean "can put error handing here"?
Do I literally wrap this code around the whole template??
Re: Why am I getting diamonds with ? for German chars?
Posted: Sat Jul 04, 2015 7:38 am
by Celauran
Did requinix' suggestion not work?
Re: Why am I getting diamonds with ? for German chars?
Posted: Sat Jul 04, 2015 9:11 am
by simonmlewis
I would not know what "setting" to look for.
Re: Why am I getting diamonds with ? for German chars?
Posted: Sat Jul 04, 2015 1:55 pm
by hybris
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());
}
I usually put it right before my first db call.. (You need it for both writing to or reading from the db)
Hope it helps.. I got really tired of those wierd signs to replace åäö

Re: Why am I getting diamonds with ? for German chars?
Posted: Tue Jul 07, 2015 10:26 am
by simonmlewis
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?