I am having trouble getting the £ symbol to render properly in a title tag.
I have tried using £ which comes out as a ? in a diamond. I have also tried:
£
but that comes out as is.
I have also tried setting:
header('Content-Type: text/html; charset=utf-8');
Before the output is echoed.
Here is how I am generating the content for the title tag:
public function marginAttribution($enquiryId)
{
$data = $this->model->marginAttribution($enquiryId) ;
$output = '';
$output .= 'Sales value (parts): '.$data['sellingCurrency'].number_format($data['sellingValueNative'], 2, '.', ',')."\n";
$output .= 'Sales value (fees): '.$data['sellingCurrency'].number_format($data['sellingFees'], 2, '.', ',')."\n";
$output .= 'Sales value total ('.$data['sellingCurrency'].'): '.$data['sellingCurrency'].number_format($data['sellingFees']+$data['sellingValueNative'], 2, '.', ',')."\n";
$output .= "Sales value total (£): £".number_format(($data['sellingFees']+$data['sellingValueNative'])/$data['sellingCurrencyRate'], 2, '.', ',')."\n";
header('Content-Type: text/html; charset=utf-8');
echo $output;
}