Hi David!
Strange problem, when using search.php on a merchant, all the products names and descriptions are perfect but when seeing the same products in the product (products.php) page, the description appears with strange characters, like this ��.
Can you help me out with this?
Many many thanks,
Pedro
There is nothing before the Notice: Undefined variable: product like the product doesn't exist. The URL cannot have those crazy characters.
In the database all the characters are perfectly right.
I've also forced the headers to be utf-8 using the header("Content-Type: text/html;charset=utf-8") in the products.php and search.php scripts and it still doesn't work.
I've changed around the browser character encoding to another encoding besides utf-8 and it works.
Special characters are the characters below:
'Š'=>'S', 'š'=>'s', 'Ð'=>'D', 'd'=>'d', 'Ž'=>'Z', 'ž'=>'z', 'C'=>'C', 'c'=>'c', 'C'=>'C', 'c'=>'c',
'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss',
'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e',
'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',
'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b',
'ÿ'=>'y', 'R'=>'R', 'r'=>'r', '\''=>' ', '"'=>' '
Any help please?
Hi Pedro,
Please could you email me a link to you site and I'll take a look and see what's going on...
Cheers,
David.
--
PriceTapestry.com
Hi David, I figured it out!
I actually changed the $configCharset to ISO-8859-1 and it works.
How bizarra is that? The database is in UTF-8 and the PHP displays the page in ISO-8859-1 and it works fine...
Hi Pedro,
Glad you're up and running! The character set of the database only really has any bearing on the use of multibyte string functions within the SQL, so even if collation is set to UTF-8 it will still store and return ISO-8859-1 correctly.
Cheers,
David.
--
PriceTapestry.com
Hi Pedro,
This sounds like something on your product page (products.php is preventing html/header.php from sending the character set header which is required to make sure that that extended characters are displayed correctly.
Could you check that your products.php has not accidentally had some white space (any characters, especially new-lines) before the opening <?php tag at the top, as that could cause this to happen - that should be all it is...
Cheers,
David.
--
PriceTapestry.com