I have an issue with - it seems - the character set when using external.php
For example, it shows: België in stead of België.
I don't have this issue upon search or the productpage.
Only when using external.php.
I checked for blank pages, and if the header loads correctly.
That's all OK, and it does seem to load the UTF-8 charset.
Maybe there is a newer version of external.php?
The one I'm using is about 2 years old I guess, and I use it with a new installation of PT.
Hello David,
Actually I'm not using it on an external site, but on the same website as my Price Tapestry installation.
I create pages like mylandingpage.php and use this calling code:
<?php
$common_baseHREF = "/";
$common_path = "{mypath}";
$_GET["q"] = "{search term}";
require($common_path."external.php");
?>
Maybe this is not the best way to do it though..
Hi pieter,
Just add the following to the top (after the opening PHP tag)
header("Content-type: text/html; charset=utf-8");
Cheers,
David.
--
PriceTapestry.com
hey david i have a similar problem with pieter..
encoding one..
i use pricetapestry in wordpress but the search result of products that i have in greek dont print like it shoul be...
i use that to call the search
<?php
$common_baseHREF = "/";
$common_path = "{mypath}";
$_GET["q"] = "{search term}";
require($common_path."search.php");
?>
Cannot modify header information - headers already sent by (output started at /home/xxxx/public_html/wordpress/wp-content/themes/application/header.php:1) in /home/xxxxx/public_html/wordpress/wp-content/themes/application/search.php on line 11
(i cant see greek letters in sql tables they are corrupt but when i use the default pricetapestry template it works fine).. can you help me with that..
Hi konpapdo,
I would double-check that the output of your Wordpress site is in UTF-8. You can do this using your web browser's View > Character Encoding menu, which should indicate which encoding is currently selected. If that doesn't appear to be UTF-8 then from the error message I can see that the output of your Wordpress theme begins at /wordpress/wp-content/themes/application/header.php so it would be worth double-checking there that the correct character set headers are being sent...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
hey david, as i see the database and the tables instaled by default is in latin encoding where can i put
mysql_query( "SET NAMES utf8", $dbconnect );
mysql_query( "SET CHARACTER SET utf8", $dbconnect );
Hi konpapdo,
You could try adding those at the top of your modified search.php - _after_ the existing require() statements so that database.php will have been included. The code would be:
$sql = "SET NAMES utf8";
database_querySelect($sql,$result);
$sql = "SET CHARACTER SET utf8";
database_querySelect($sql,$result);
Cheers,
David.
--
PriceTapestry.com
Hello pieter,
This would indicate that the external site on which you are using external.php is not generating output in the same character set as your Price Tapestry installation is configured to do so. Anything generated by external.php occurs after your external site will have defined the character set, so $config_charset is not actually applicable in the external scripts.
What you would need to do is double check the configuration of your external site and make sure that it is the same as your Price Tapestry installation (UTF-8) - it sounds like it is currently generating output in ISO-8859-1.
Cheers,
David.
--
PriceTapestry.com