0

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;
  }
imperium2335
  • 23,402
  • 38
  • 111
  • 190

1 Answers1

0

I needed to edit the Netbeans config file as discussed in the answer in this post:

How to change file encoding in NetBeans?

Which solved my problem.

Community
  • 1
  • 1
imperium2335
  • 23,402
  • 38
  • 111
  • 190