You are here

public function FrxControls::convertCharset in Forena Reports 6.2

2 calls to FrxControls::convertCharset()
FrxControls::csvDocument in plugins/FrxControls.inc
Generate the CSV document.
FrxControls::xlsDocument in plugins/FrxControls.inc

File

plugins/FrxControls.inc, line 324
contains various methods for extending report formating, layout, transformation and design.

Class

FrxControls
@file contains various methods for extending report formating, layout, transformation and design.

Code

public function convertCharset($data) {
  if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) {
    $parts = @explode(';', $_SERVER['HTTP_ACCEPT_CHARSET']);
    $parts = @explode(',', $parts[0]);
    $to_encoding = @$parts[0];
    if ($to_encoding) {
      $data = mb_convert_encoding($data, $to_encoding, 'UTF-8');
    }
  }
  return $data;
}