Forum
mysqli_set_charset($c, "utf8");
Hi, I'm using $DB = PerchDB::fetch(); but need to use: mysqli_set_charset($c, "utf8"); top stop £ sign coming out as black dimond with a question mark. �
what is the correct way to do this.
thanks in advance
tony
Unless you define
PERCH_DB_CHARSET
to use something other than UTF8, Perch uses UTF8 by default.If you're using UTF8 and serving your pages as UTF8 you should have no issues.
this is being displayed in perch shop/orders/order details. and the database is set as utf8 - default collation
I've found the only way to get £ to display correctly is to use. mysqli_set_charset($c, "utf8"); I've had this issue with other sites, but this time its inside perch.
how can I get the DB link, or where in perch is fetch() function.
thanks in advance
tony
What happens if you enter a
£
in a regular Perch content region?£ in regular perch content, appears on website ok.
so not sure what up...
had a look at perch/core/perchDB. but looks tricky to change.
tony
this works!!!
That you need this is an indication of a bigger problem in your code. Perch handles UTF8 without issue, so it must be something in your code that is introducing this problem.
my code i added to: orders.detail.pre.php
$shippingMethod = @urldecode($shopLogArray['custom']);
I need to extract the paypal custom ( for shipping method) and option_name & option_selection. so my client can see the size colour and shipping in order details page.
the logData is coming from paypal.
tony
Ok - is it working, or do you have a question about it?
Hi Drew,
the char encoding for logData is ASCII, so not sure why £ nor display right. but I have to use the to_utf8 function.
thanks for your help.
tony